Fixed #16591 -- Fixed some mismatched variable names in a widgets reference example. Thanks to santi.romero, el barto, and julien.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16626 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gabriel Hurley 2011-08-18 22:39:20 +00:00
parent 41b31b4d09
commit 40c8a603c3
1 changed files with 5 additions and 5 deletions

View File

@ -52,15 +52,15 @@ widget on the field. In the following example, the
BIRTH_YEAR_CHOICES = ('1980', '1981', '1982') BIRTH_YEAR_CHOICES = ('1980', '1981', '1982')
GENDER_CHOICES = (('m', 'Male'), ('f', 'Female')) GENDER_CHOICES = (('m', 'Male'), ('f', 'Female'))
FAVOURITE_COLORS_CHOICES = (('blue', 'Blue'), FAVORITE_COLORS_CHOICES = (('blue', 'Blue'),
('green', 'Green'), ('green', 'Green'),
('black', 'Black')) ('black', 'Black'))
class SimpleForm(forms.Form): class SimpleForm(forms.Form):
birth_year = DateField(widget=SelectDateWidget(years=YEAR_CHOICES)) birth_year = DateField(widget=SelectDateWidget(years=BIRTH_YEAR_CHOICES))
gender = ChoiceField(widget=RadioSelect, choices=RADIO_CHOICES) gender = ChoiceField(widget=RadioSelect, choices=GENDER_CHOICES)
favourite_colors = forms.MultipleChoiceField(required=False, favorite_colors = forms.MultipleChoiceField(required=False,
widget=CheckboxSelectMultiple, choices=CHECKBOX_CHOICES) widget=CheckboxSelectMultiple, choices=FAVORITE_COLORS_CHOICES)
See the :ref:`built-in widgets` for more information about which widgets See the :ref:`built-in widgets` for more information about which widgets
are available and which arguments they accept. are available and which arguments they accept.