Ticket #2818: search_distinct.diff

File search_distinct.diff, 520 bytes (added by Andy Dustman <farcepest@…>, 18 years ago)

Make all admin searches distinct

  • django/contrib/admin/views/main.py

     
    735735        if self.opts.one_to_one_field:
    736736            qs = qs.complex_filter(self.opts.one_to_one_field.rel.limit_choices_to)
    737737
    738         return qs
     738        return qs.distinct()
    739739
    740740    def url_for_result(self, result):
    741741        return "%s/" % quote(getattr(result, self.pk_attname))
Back to Top