Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Default column heading from field.verbose_name is not titlised, but it should be #249

Closed
chrkr opened this issue May 13, 2015 · 2 comments · Fixed by mozilla/addons-server#4430 or drummonds/bene#50

Comments

@chrkr
Copy link

chrkr commented May 13, 2015

Since the changes in 0.16.0, the default column heading is no longer passed through title() if the value is taken from a model field (field.verbose_name). It is only titlised if the column name is used (because the table is used for a list-of-dictionaries or similar dataset).

The Django convention is to not capitalize the first letter of verbose_name, as Django capitalizes it automatically whenever it is needed. This is for example so that verbose_name can be used in the middle of a sentence without unexpected capitals popping up.

From the django documentation (https://docs.djangoproject.com/en/1.8/topics/db/models/#verbose-field-names):

The convention is not to capitalize the first letter of the verbose_name. Django will automatically capitalize the first letter where it needs to.

So, Django convention is that verbose_name should be titlised whenever it is needed, so django-tables2 should in fact titlise the column name if it gets it from field.verbose_name.

@jieter
Copy link
Owner

jieter commented Jan 7, 2016

@chrkr thanks for reporting this, are you willing to make a PR?

@jieter
Copy link
Owner

jieter commented Jan 27, 2016

Hmm, this causes all kind of trouble when fixing naively. Have to dig deeper.

# for free to join this conversation on GitHub. Already have an account? # to comment