#16711: RelatedFieldListFilter and filter title
---------------------------+-------------------------------
 Reporter:  dan.klasson@…  |          Owner:  nobody
     Type:  Bug            |         Status:  new
Milestone:                 |      Component:  contrib.admin
  Version:  SVN            |       Severity:  Normal
 Keywords:                 |   Triage Stage:  Unreviewed
Has patch:  0              |  Easy pickings:  0
    UI/UX:  0              |
---------------------------+-------------------------------
 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,
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16711>
Django <https://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.

Reply via email to