My question is regarding form subclassing in Django. How would I modify some attribute, while retaining the other attributes, of an inherited field?
For example, I have a form, called SignUpForm, which subclasses from UserCreationForm.
UserCreationForm:
...
password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
...
In SignUpForm, I would like to override widget with widget=TextInput(attrs={‘size’: 30}) while keeping label the same. Is this possible? If so, how? Thanks.
You can do it in
__init__