Author: russellm Date: 2010-05-10 09:16:04 -0500 (Mon, 10 May 2010) New Revision: 13226
Modified: django/branches/releases/1.1.X/docs/ref/forms/validation.txt Log: [1.1.X] Fixed #12001 -- Modified the example of form validation to use the form's error class, rather than assuming ErrorList. Thanks to Suor for the report, and timo for the patch. Backport of r13221 from trunk. Modified: django/branches/releases/1.1.X/docs/ref/forms/validation.txt =================================================================== --- django/branches/releases/1.1.X/docs/ref/forms/validation.txt 2010-05-10 14:14:41 UTC (rev 13225) +++ django/branches/releases/1.1.X/docs/ref/forms/validation.txt 2010-05-10 14:16:04 UTC (rev 13226) @@ -260,8 +260,6 @@ effectively in your particular situation. Our new code (replacing the previous sample) looks like this:: - from django.forms.util import ErrorList - class ContactForm(forms.Form): # Everything as before. ... @@ -275,8 +273,8 @@ # We know these are not in self._errors now (see discussion # below). msg = u"Must put 'help' in subject when cc'ing yourself." - self._errors["cc_myself"] = ErrorList([msg]) - self._errors["subject"] = ErrorList([msg]) + self._errors["cc_myself"] = self.error_class([msg]) + self._errors["subject"] = self.error_class([msg]) # These fields are no longer valid. Remove them from the # cleaned data. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.