Changes between Version 1 and Version 2 of Ticket #32663


Ignore:
Timestamp:
Apr 18, 2021, 12:52:55 PM (3 years ago)
Author:
Yovel Cohen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32663 – Description

    v1 v2  
    4040model_scores_latest_date_annotation = Max('model_scores__date')
    4141latest_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)
     42base_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                                )
    4348
    4449}}}
Back to Top