How to get rid of help text on a ModelForm?

96 views
Skip to first unread message

Daniel Grace

unread,
Oct 27, 2014, 10:42:04 AM10/27/14
to django...@googlegroups.com
Hi,
I have a ModelForm for creating users, but it shows some help text "Required. 30 characters..." next to the username field.
How do I get rid of this text?  I tried the following, but the text remains on the form:

class UserForm(forms.ModelForm):
    password = forms.CharField(widget=forms.PasswordInput())
    class Meta:
        model = User
        fields = ['username', 'email', 'password']
        def __init__(self, *args, **kwargs):
            super(UserForm, self).__init__(*args, **kwargs)
            for fieldname in self.fields:
                self.fields[fieldname].help_text = None

Any ideas?
Thanks

Daniel Grace

unread,
Oct 28, 2014, 3:47:04 PM10/28/14
to django...@googlegroups.com
Oops, too much indentation on the "def ..." line.
Reply all
Reply to author
Forward
0 new messages