Mitch
Mitch

Reputation: 2400

Can I force the first letter of the verbose_name of a django model field to be lower case?

Django automatically capitalizes the first letter of the verbose_name of a field in a model. I'd like it to be lower case. Is there a way to do that?

Upvotes: 2

Views: 717

Answers (2)

Mitch
Mitch

Reputation: 2400

A workable but somewhat kludgy solution that I am going to use is to make the first character of my verbose_name strings the unicode Zero Width Space (\u200B).

Upvotes: 1

Mikhail Polykovskii
Mikhail Polykovskii

Reputation: 2393

Override template 'admin/index.html' and change

<th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>

to

<th scope="row"><a href="{{ model.admin_url }}">{{ model.name|lower }}</a></th>

Upvotes: 2

Related Questions