#2361: QuerySet.filter(m2mfield__isnull=False) may return duplicates
-------------------------------------+-------------------------------------
Reporter: daniel.tietze@… | Owner: Norbert
| Stüken
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Norbert Stüken):
Hi Mariusz,
both examples address potential duplicates when using m2m relationships.
However, the already documented example at the end of the "Spanning multi-
valued relationship" section states that the duplicates are yielded since
multiple filters are chained and therefore resulting in multiple joins
compared to using only one filter.
My example does not address multiple filters, but shows the quite
unexpected behavior of m2m relations using just one filter which is the
reason this ticket was created.
I can't follow this behavior out of the example in "Spanning multi-valued
relationships".
As stated, in my opinion, both examples show different screnarios of how
m2m relationships can yield duplicates. Maybe linking both examples to
each other and explaining their difference would make it clearer.
--
Ticket URL: <https://code.djangoproject.com/ticket/2361#comment:18>
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/0107018414470008-e76ab55a-8959-4868-8da3-f027dbc20bc0-000000%40eu-central-1.amazonses.com.