Opened 11 years ago

Closed 11 years ago

#21299 closed Bug (fixed)

verbose_name inconsistently capitalized in admin inlines

Reported by: Renato Oliveira Owned by: nobody
Component: contrib.admin Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When I create an instance of a BaseInlineAdmin, the given verbose_name is capitalized. If I give an abbreviation like 'ABC' to verbose_name, it displays 'Abc'.

The same behavior happens in the verbose_name_plural, but only in the StackedInline model.

I'm willing to fix this if it's accepted as a bug.

Change History (4)

comment:1 by Renato Oliveira, 11 years ago

Sorry, InlineModelAdmin

comment:2 by Tim Graham, 11 years ago

Summary: verbose_name capitalized in Admin inlinesverbose_name inconsistently capitalized in admin inlines
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

django/contrib/admin/templates/admin/edit_inline/stacked.html uses the title filter, while tabular.html uses capfirst. I suppose both could use capfirst.

The bug stems from this behavior of the title filter:

>>> from django.template.defaultfilters import capfirst, title
>>> title("ABC News")
u'Abc News'

I've created #21306 to document (or possibly change) this behavior.

comment:3 by Renato Oliveira, 11 years ago

I sent a pull request, but I don't know how to test this.

https://github.com/django/django/pull/1800

comment:4 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 43569647ab234cd1d2f4d41399b97b4b793d573a:

Fixed #21299 - Changed filters from title to capfirst on admin inline formsets.

Previously there was a mixture of the two which resulted in inconsistent
casing.

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