diff --git a/alyx/subjects/admin.py b/alyx/subjects/admin.py index 6febd819..40b7125b 100755 --- a/alyx/subjects/admin.py +++ b/alyx/subjects/admin.py @@ -126,16 +126,26 @@ def lookups(self, request, model_admin): (None, 'All'), ('p', 'All positive'), ('h', 'All homo'), + ('n', 'All negative'), + ('e', 'All het') ) def queryset(self, request, queryset): if self.value() is None: return queryset.all() - elif self.value() in ('p', 'h'): + elif self.value() in ('p', 'h', 'n', 'e'): # Only keep subjects with a non-null geontype. queryset = queryset.filter(genotype__isnull=False).distinct() - # Exclude subjects that have a specific zygosity/ - d = dict(zygosity=0) if self.value() == 'p' else dict(zygosity__in=(0, 1, 3)) + # Exclude subjects that have a specific zygosity + # See alyx/alyx/subjects/models.py - ZYGOSITY_TYPES for explanation + if self.value() == 'p': + d = dict(zygosity=0) + elif self.value() == 'h': + d = dict(zygosity__in=(0, 1, 3)) + elif self.value() == 'n': + d = dict(zygosity__in=(1, 2, 3)) + else: + d = dict(zygosity__in=(0, 2, 3)) nids = set([z.subject.id.hex for z in Zygosity.objects.filter(**d)]) return queryset.exclude(pk__in=nids) diff --git a/requirements_frozen.txt b/requirements_frozen.txt index c7154991..dc28731a 100644 --- a/requirements_frozen.txt +++ b/requirements_frozen.txt @@ -1,12 +1,12 @@ asgiref==3.7.2 backports.zoneinfo==0.2.1 -boto3==1.33.4 -botocore==1.33.4 +boto3==1.33.8 +botocore==1.33.8 certifi==2023.11.17 cffi==1.16.0 charset-normalizer==3.3.2 click==8.1.7 -colorlog==6.7.0 +colorlog==6.8.0 contourpy==1.1.1 coreapi==2.3.3 coreschema==0.0.4 @@ -14,7 +14,7 @@ coverage==6.5.0 coveralls==3.3.1 cryptography==41.0.7 cycler==0.12.1 -Django==4.2.7 +Django==4.2.8 django-admin-list-filter-dropdown==1.0.3 django-admin-rangefilter==0.11.2 django-autocomplete-light==3.9.7 @@ -33,12 +33,12 @@ docopt==0.6.2 docutils==0.20.1 drfdocs==0.0.11 flake8==6.1.0 -fonttools==4.45.1 +fonttools==4.46.0 globus-cli==3.19.0 globus-sdk==3.30.0 iblutil==1.7.1 idna==3.6 -importlib-metadata==6.8.0 +importlib-metadata==7.0.0 importlib-resources==6.1.1 itypes==1.2.0 Jinja2==3.1.2