Reputation: 155
I have a modelform:
class SubmitDomain(ModelForm):
emailVerified = forms.CharField(max_length=50, required=False, widget=forms.TextInput(attrs={'class': 'validate', 'id': 'emailVerified'}))
domainNm = forms.CharField(max_length=40, required=False, widget=forms.TextInput(attrs={'class': 'validate', 'id': 'domainNm'}))
In versions of django before 2+ I was able to just create verbose_name=something
to change the display value of a modelform's field name different from what the model's field name actually is.
For example, on my form it displays:
domainNm
and emailVerified
How can I get it to display:
Domain Name
Verifying Email
Thank you in advance.
Upvotes: 0
Views: 150
Reputation: 599610
verbose_name
is an an attribute of model fields, not form fields. For forms you use label
. Neither of these have changed in Django 2.
Upvotes: 1