--
Ticket URL: <https://code.djangoproject.com/ticket/18437>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_docs: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
This is a feature. See:
[https://docs.djangoproject.com/en/1.4/topics/db/queries/#spanning-multi-
valued-relationships].
Yes, it can be confusing...
--
Ticket URL: <https://code.djangoproject.com/ticket/18437#comment:1>
Comment (by vdboor):
Ah, I understand, this has a use case too.
Perhaps a `..note::` would be good to add to the docs.
I didn't notice it before, only now that I know it exists I see which
sentence makes a subtle reference to it.
--
Ticket URL: <https://code.djangoproject.com/ticket/18437#comment:2>
Comment (by akaariai):
There might be room for improvement here. If you can provide a patch that
would be great (or, at least where in the docs you would like to see an
addition, and what to add there).
--
Ticket URL: <https://code.djangoproject.com/ticket/18437#comment:3>
Comment (by anonymous):
I just ran into this issue. If you are doing filtering and later add some
annotations like Count, Sum, etc. this is a unpleasant surprise and giving
you wrong results.
--
Ticket URL: <https://code.djangoproject.com/ticket/18437#comment:4>
Comment (by phuongcv1112):
We can use: FilteredRelation to specify 1 relation (and join 1 time) only:
https://docs.djangoproject.com/en/3.0/ref/models/querysets
/#filteredrelation-objects
--
Ticket URL: <https://code.djangoproject.com/ticket/18437#comment:5>