Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #826

Merged
merged 4 commits into from
Dec 6, 2023
Merged

Dev #826

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions alyx/subjects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions requirements_frozen.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
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
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
Expand All @@ -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
Expand Down
Loading