Opened 13 years ago

Closed 13 years ago

#16711 closed Bug (duplicate)

RelatedFieldListFilter and filter title

Reported by: dan.klasson@… Owned by: nobody
Component: contrib.admin Version: dev
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

Description

The class RelatedFieldListFilter in /django-trunk/django/contrib/admin/filters.py 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 by Julien Phalip, 13 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #15221.

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