Opened 5 years ago

Closed 5 years ago

#16711 closed Bug (duplicate)

RelatedFieldListFilter and filter title

Reported by: dan.klasson@… Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: dan.klasson@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The class RelatedFieldListFilter in /django-trunk/django/contrib/admin/ has a bug in it.

If I have this model and admin class:

class SomeModel(models.Model):
    deposit = models.ManyToManyField(PaymentMethod, related_name="deposit")
    withdrawal = models.ManyToManyField(PaymentMethod, related_name="withdrawal")

class SomeModelAdmin(admin.ModelAdmin):
    list_filter('deposit', 'withdrawal')

I expect the filter name/title of 'deposit' and 'withdrawal' on the listing page to be "By Deposit" and "By Withdrawal". And not "By Payment Method".

Line 151 should be:

if not isinstance(field, (models.ManyToManyField,

Instead of:

if isinstance(field, (models.ManyToManyField,

Change History (1)

comment:1 Changed 5 years ago by Julien Phalip

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

This is a duplicate of #15221.

Note: See TracTickets for help on using tickets.
Back to Top