#15819: Admin searches should use distinct, if query involves joins
-------------------------------------+-------------------------------------
Reporter: Adam | Owner: aip@…
Kochanowski <aip@…> | Status: reopened
Type: Bug | Component: contrib.admin
Milestone: | Severity: Normal
Version: 1.3 | Keywords:
Resolution: | Has patch: 0
Triage Stage: | Needs tests: 0
Unreviewed |
Needs documentation: 0 |
Patch needs improvement: 0 |
-------------------------------------+-------------------------------------
Comment (by carljm):
Confirmed that this is a problem, and that it is a regression in 1.3.
It should just be fixed outright, not with a ModelAdmin option - there's
no use case for duplicate search results.
As for use of distinct not being simple - this is what .distinct() is for.
If there are bugs in distinct(), we need to fix them, not avoid using it.
It does appear that we should fix #15559 along with this (and also re-
apply the fix for #11707). However, that doesn't mean that work on a patch
here needs to be stalled waiting for #15559.
I don't think we should call .distinct() unconditionally - just expand the
checks from r15526 so they catch the non-M2M cases that might cause dupe
results.
--
Ticket URL: <http://code.djangoproject.com/ticket/15819#comment:6>
Django <http://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 this group at
http://groups.google.com/group/django-updates?hl=en.