Changes between Version 2 and Version 3 of Ticket #32663


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32663 – Description

    v2 v3  
    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.
    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                                 )
     42base_query_set = 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                  )
    4848
    4949}}}
Back to Top