#13902: When using a ManyToMany in list_filter, results may apper more than once ------------------------------------------------------+--------------------- Reporter: rasca | Owner: nobody Status: new | Milestone: Component: django.contrib.admin | Version: 1.2 Keywords: admin change_list list_filter manytomany | Stage: Unreviewed Has_patch: 0 | ------------------------------------------------------+--------------------- Suppose you have a ManyToMany relationship between models A and B through a model C. If you have more than one entry of C relating the same A and B instances, and in the admin in the model A change_list you are list_filtering by the relationship with B, and filter by the B instance that has more than 1 relation to the same A instance, the A instance appears as many times as there are relationships in the list, when it should appear only once.
I'm not sure where to add the .distinct() in admin.views.ChangeList.get_query_set(). We could add it when it returns the final queryset but I'm not sure if that's the most efficient way to do it. We could check to see if it's needed. There's also another .distinct() before but that one only applies to the search field (in case it's needed). Maybe combine these two? -- Ticket URL: <http://code.djangoproject.com/ticket/13902> 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.
