#29271: Chaining Filters on a Reverse Foreign Key Produces Multiple Joins
-------------------------------------+-------------------------------------
Reporter: Michael MacIntosh | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: filter chain | Triage Stage:
reverse foreign key | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Timothy Hobbs):
* status: closed => new
* resolution: invalid =>
* stage: Accepted => Unreviewed
Comment:
Can this bug please be re-opened?
Simon Charette's comment appears to be clarifying that two filter's are
intended to be different from one. I get that, that IS expected behavior.
What is NOT expected behavior is the duplication of the entries in the
results and that behavior goes directly against the current documentation:
'The second filter restricts the set of blogs further'
The word 'restricts' is used multiple times in that seciton. The word
'duplicates' never occurs.
That behavior is not only unexpected and undocumented, but never useful.
Doing a `.count()` on the results gives a bad result, displaying the
duplicated data is never desirable, mapping over the duplicated data can
lead to corruption. This behavior is literally always wrong and very hard
to catch in testing.
--
Ticket URL: <https://code.djangoproject.com/ticket/29271#comment:7>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.38053305584469c9d41be44a3751fcdf%40djangoproject.com.