My question is about subclassing forms in Django. How to change some attribute while keeping other attributes of the 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 redefine the widget with widget = TextInput (attrs = {'size: 30}), while retaining the label. Is it possible? If so, how? Thanks.
source share