Hi Bastian,
you need to define the restrictions on the username field. It can be
done by including the code below inside usernameForm. This code is
from django/contrib/auth/forms.py -> UserCreationForm, you can refer
it to understand further.
username = forms.RegexField(label="Username", max_l
Yes that's what I ended up doing but isn't it supposed to be automatic,
coming from the restrictions of the model since it's a ModelForm?
On Thursday, April 5, 2012 7:51:14 PM UTC+2, Pavan Verma wrote:
>
> Hi Bastian,
> you need to define the restrictions on the username field. It can be
> done
I went through django/contrib/auth/models.py to check the definition
of the User model. I don't see this file defining any restrictions on
what a username can be. So, I think the form is the place (and
possibly the only place) which defines and enforces restrictions on
what the username can be.
In
I assumed restrictions would apply at model level but it's not the case.
About the ModelForm, isn't it the point of using a ModelForm? (with the
User model as shown in the example of course) that it inherits from the
model and automatically creates the right fields, widgets, and restrictions?
r
4 matches
Mail list logo