On 04/20/2011 10:42 AM, Ryan K wrote:
> Today I discovered behavior similar to that originally reported in
> #15819 (http://code.djangoproject.com/ticket/15819). I've updated it
> with a simple way to reproduce the issue. Could anyone confirm this
> behavior? It's nothing major but it does seem that the admin search
> behavior changed from 1.2.5 to 1.3.
I can reproduce the issue (and confirm that it is a regression in 1.3),
and I've accepted the ticket.
> Would it be possible to add a boolean, say 'search_distinct', to
> ModelAdmin so distinct() is called after a search here:
> http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/main.py#L271
> ?
Is there any reason why someone would _want_ duplicate search results? I
don't think so, so there is no reason for a ModelAdmin option here - it
should just be fixed.
> I haven't yet contributed to the project but would like to if this is
> indeed something that should be fixed.
That'd be great! Patch should be against SVN trunk, and include a test
that fails before the fix and passes afterwards, in
tests/regressiontests/admin_views/tests.py. Feel free to hit me up on
IRC (carljm) or here if you have questions working on the patch. I made
some additional comments on the ticket. Thanks!
Carl