How to prevent Django from auto-capitalizing of the verbose_name in models? E.g:
class TestModel(models.Model):
enb_id = models.IntegerField(null=True, v
It seems that Django capitalizes the first letter when setting the form field for that model field:
...
defaults = {
'required': not self.blank,
'label': capfirst(self.verbose_name),
'help_text': self.help_text
}
You could create your own custom model field that overwrites the capfirst
(by passing the label as kwarg):
from django.db import models
class UpcappedModelField(models.Field):
def formfield(self, form_class=forms.CharField, **kwargs):
return super(UpcappedModelField, self).formfield(form_class=forms.CharField,
label=self.verbose_name, **kwargs)