1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #16609 -- Fixed duplicate admin results when searching nested M2M relations.

This was fixed earlier but only when the M2M relation was at the first
level on the object. This commit fixes the issue even when the M2M is
at deeper levels, such as behind a foreign key.
This commit is contained in:
Samuel Paccoud
2015-04-14 11:09:58 +02:00
committed by Tim Graham
parent 4dcc649341
commit d084176cc1
4 changed files with 78 additions and 9 deletions

View File

@@ -60,6 +60,11 @@ class GroupAdmin(admin.ModelAdmin):
list_filter = ['members']
class ConcertAdmin(admin.ModelAdmin):
list_filter = ['group__members']
search_fields = ['group__members__name']
class QuartetAdmin(admin.ModelAdmin):
list_filter = ['members']