{{{
from django.forms import DateField, CharField, PasswordInput, TextInput
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from login.models import Fan
class FanForm(UserCreationForm):
birthday = DateField(input_formats=['%d-%m-%Y', '%d/%m/%Y'])
class Meta:
model = Fan
fields = ['username', 'email', 'first_name', 'last_name',
'birthday', 'gender', 'password1', 'password2']
widgets = {
'username': TextInput(attrs={'data': 'meu nome', 'class': 'my-
class'}),
}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24626>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_docs: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
It doesn't work on 1.7 because `UserCreationForm` declares the `username`
field so `Meta.widgets` doesn't have an effect for that field. It does
work on 1.8+ because the `username` field has been removed as of
849538d03df21b69f0754a38ee4ec5f48fa02c52.
--
Ticket URL: <https://code.djangoproject.com/ticket/24626#comment:1>