from django import forms
class UserForm(forms.ModelForm):
first_name = forms.TextField(label=_(u'First name'), required=False)
last_name = forms.TextField(label=_(u'Last name'))
Me da un "AttributeError: 'módulo' objeto no tiene atributo 'TextField' Todo parece estar bien, excepto el campo de texto que falta:.TextField desaparecidos en django.forms
ipdb> forms
<module 'django.forms' from '/usr/local/lib/python2.7/dist-packages/django/forms/__init__.pyc'>
ipdb> forms.
forms.BaseForm forms.EmailField forms.MultiWidget forms.TypedChoiceField
forms.BaseModelForm forms.Field forms.MultipleChoiceField forms.TypedMultipleChoiceField
forms.BooleanField forms.FileField forms.MultipleHiddenInput forms.URLField
forms.CharField forms.FileInput forms.NullBooleanField forms.ValidationError
forms.CheckboxInput forms.FilePathField forms.NullBooleanSelect forms.Widget
forms.CheckboxSelectMultiple forms.FloatField forms.PasswordInput forms.fields
forms.ChoiceField forms.Form forms.RadioSelect forms.fields_for_model
forms.ClearableFileInput forms.HiddenInput forms.RegexField forms.forms
forms.ComboField forms.IPAddressField forms.Select forms.formsets
forms.DEFAULT_DATETIME_INPUT_FORMATS forms.ImageField forms.SelectMultiple forms.model_to_dict
forms.DEFAULT_DATE_INPUT_FORMATS forms.IntegerField forms.SlugField forms.models
forms.DEFAULT_TIME_INPUT_FORMATS forms.Media forms.SplitDateTimeField forms.save_instance
forms.DateField forms.MediaDefiningClass forms.SplitDateTimeWidget forms.util
forms.DateInput forms.ModelChoiceField forms.TextInput forms.widgets
forms.DateTimeField forms.ModelForm forms.Textarea
forms.DateTimeInput forms.ModelMultipleChoiceField forms.TimeField
forms.DecimalField forms.MultiValueField forms.TimeInput
Alguna idea?
'forms.TextInput' no es lo que necesita? – Nemoden
No. TextInput es el widget utilizado por campo. – zVictor