Changes between Version 1 and Version 2 of Ticket #32663
- Timestamp:
- Apr 18, 2021, 12:52:55 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32663 – Description
v1 v2 40 40 model_scores_latest_date_annotation = Max('model_scores__date') 41 41 latest_score_annotation = Case(When(model_scores__date=F('latest_date'), then='model_scores__score') 42 base_query_set = (Model.objects.filter(**filters).alias(latest_date=model_scores_latest_date_annotation).values(ID).annotate(latest_score=latest_score_annotation, latest_date=model_scores_latest_date_annotation) 42 base_query_set = (Model.objects. 43 filter(**filters). 44 alias(latest_date=model_scores_latest_date_annotation). 45 values(ID). 46 annotate(latest_score=latest_score_annotation, latest_date=model_scores_latest_date_annotation) 47 ) 43 48 44 49 }}}