Skip to content
Snippets Groups Projects
Commit 792a1293 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

correct the computing of pktest_av and cytoxtest_av for Compound

fix #223
parent 773d61ca
No related branches found
No related tags found
No related merge requests found
......@@ -1747,37 +1747,12 @@ def update_compound_cached_properties(compounds_queryset=None):
),
pktest_av=Subquery(
compounds_queryset.filter(id=OuterRef("id"))
.annotate(
_pktest_av=Cast(
Max(
Case(
When(
refcompoundbiblio__bibliography__pharmacokinetic=True,
then=1,
),
default=0,
output_field=IntegerField(),
)
),
BooleanField(),
)
)
.annotate(_pktest_av=Count("compoundpkresult", distinct=True))
.values("_pktest_av")[:1]
),
cytoxtest_av=Subquery(
compounds_queryset.filter(id=OuterRef("id"))
.annotate(
_cytoxtest_av=Cast(
Max(
Case(
When(refcompoundbiblio__bibliography__cytotox=True, then=1),
default=0,
output_field=IntegerField(),
)
),
BooleanField(),
)
)
.annotate(_cytoxtest_av=Count("compoundcytotoxicityresult", distinct=True))
.values("_cytoxtest_av")[:1]
),
insilico_av=Subquery(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment