Loading docs/ref/forms/validation.txt +4 −2 Original line number Diff line number Diff line Loading @@ -365,8 +365,10 @@ example:: if cc_myself and subject: # Only do something if both fields are valid so far. if "help" not in subject: raise forms.ValidationError("Did not send for 'help' in " "the subject despite CC'ing yourself.") raise forms.ValidationError( "Did not send for 'help' in the subject despite " "CC'ing yourself." ) .. versionchanged:: 1.7 Loading docs/ref/forms/widgets.txt +10 −5 Original line number Diff line number Diff line Loading @@ -56,9 +56,11 @@ for a :class:`~django.forms.extras.widgets.SelectDateWidget`:: from django.forms.extras.widgets import SelectDateWidget BIRTH_YEAR_CHOICES = ('1980', '1981', '1982') FAVORITE_COLORS_CHOICES = (('blue', 'Blue'), FAVORITE_COLORS_CHOICES = ( ('blue', 'Blue'), ('green', 'Green'), ('black', 'Black')) ('black', 'Black'), ) class SimpleForm(forms.Form): birth_year = forms.DateField(widget=SelectDateWidget(years=BIRTH_YEAR_CHOICES)) Loading Loading @@ -354,8 +356,11 @@ foundation for custom widgets. widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)] try: D = date(day=int(datelist[0]), month=int(datelist[1]), year=int(datelist[2])) D = date( day=int(datelist[0]), month=int(datelist[1]), year=int(datelist[2]), ) except ValueError: return '' else: Loading docs/ref/forms/fields.txt +17 −17 File changed.Contains only whitespace changes. Show changes Loading
docs/ref/forms/validation.txt +4 −2 Original line number Diff line number Diff line Loading @@ -365,8 +365,10 @@ example:: if cc_myself and subject: # Only do something if both fields are valid so far. if "help" not in subject: raise forms.ValidationError("Did not send for 'help' in " "the subject despite CC'ing yourself.") raise forms.ValidationError( "Did not send for 'help' in the subject despite " "CC'ing yourself." ) .. versionchanged:: 1.7 Loading
docs/ref/forms/widgets.txt +10 −5 Original line number Diff line number Diff line Loading @@ -56,9 +56,11 @@ for a :class:`~django.forms.extras.widgets.SelectDateWidget`:: from django.forms.extras.widgets import SelectDateWidget BIRTH_YEAR_CHOICES = ('1980', '1981', '1982') FAVORITE_COLORS_CHOICES = (('blue', 'Blue'), FAVORITE_COLORS_CHOICES = ( ('blue', 'Blue'), ('green', 'Green'), ('black', 'Black')) ('black', 'Black'), ) class SimpleForm(forms.Form): birth_year = forms.DateField(widget=SelectDateWidget(years=BIRTH_YEAR_CHOICES)) Loading Loading @@ -354,8 +356,11 @@ foundation for custom widgets. widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)] try: D = date(day=int(datelist[0]), month=int(datelist[1]), year=int(datelist[2])) D = date( day=int(datelist[0]), month=int(datelist[1]), year=int(datelist[2]), ) except ValueError: return '' else: Loading