Changes between Initial Version and Version 1 of Ticket #18375, comment 22


Ignore:
Timestamp:
May 30, 2013, 7:37:45 AM (11 years ago)
Author:
German M. Bravo

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18375, comment 22

    initial v1  
    88How far is django from such behavior? ...and also, it doesn't still feel entirely good (annotate always creating new joins for such cases), since one might actually want to get the reused join... I would probably suggest the order of the calling of annotate to change things (if putting annotate after the filter, it'd reuse the joins from the previous filter, otherwise it would start afresh). This way, the next query would be equivalent to the first one:
    99`People.objects.filter(friends__age__gt=F('twice_age')).annotate(twice_age=F('friends__age') * 2)`
    10 Provided one could use `F()` of non-yet "annotated" things.
     10Provided one could use `F()` of not yet "annotated" things.
    1111
    1212Any thoughts regarding this?
Back to Top