Re: Model's verbose_name not getting used as field label when specifying a field type in ModelForm

2019-02-01 Thread Michael Corey
Yup, that works! Thank you! On Friday, February 1, 2019 at 2:17:23 PM UTC-8, Tim Graham wrote: > > When you add a form field like that, it removes inheritance of field > attributes like verbose_name from the model. > > Instead, you could override Form.__init__() and set the widget similar to >

Re: Model's verbose_name not getting used as field label when specifying a field type in ModelForm

2019-02-01 Thread Tim Graham
When you add a form field like that, it removes inheritance of field attributes like verbose_name from the model. Instead, you could override Form.__init__() and set the widget similar to what's described at https://docs.djangoproject.com/en/stable/ref/forms/widgets/ "Or if the field isn’t

Model's verbose_name not getting used as field label when specifying a field type in ModelForm

2019-02-01 Thread Michael Corey
I'm having trouble getting the verbose_name attribute of a model field to show up when rendering a ModelForm. instead, the label uses the pretty version of the field name, not the verbose_name. This occurs any time I specify a field type, and works properly (shows the verbose_name) if I don't