#19415: Invalid result when using multiple reverse foreign-key filters together
with reverse foreign-key aggregate
---------------------------------+--------------------------------------
     Reporter:  svniemeijer@…    |                    Owner:  nobody
         Type:  Bug              |                   Status:  closed
    Component:  ORM aggregation  |                  Version:  1.5-beta-1
     Severity:  Normal           |               Resolution:  invalid
     Keywords:                   |             Triage Stage:  Unreviewed
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------

Comment (by svniemeijer@…):

 Thanks! Combining everything into a single .filter() does indeed solve the
 problem.

 However, the aggregate part is not entirely a red herring and some
 clarification in the documentation on aggregation could be useful to
 prevent others making this mistake.

 In the documentation topics/db/queries/#spanning-multi-valued-
 relationships it is already clarified how subsequent filter() calls are
 treated. However, it may be good to have a similar section in
 topics/db/aggregation/#filtering-on-annotations that explains how
 aggregates on multi-valued relationships behave in case multiple filter()
 statements are used.

 There is also no example that shows how to filter using multiple
 conditions in topics/db/aggregation/#filtering-on-annotations . Adding
 such an example (using a single .filter() call) would have probably
 already guided me in the right direction.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19415#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to