Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12001 -- Modified the example of form validation to use the fo…

…rm's error class, rather than assuming ErrorList. Thanks to Suor for the report, and timo for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit bc82e20370d9f0f2e55228bd680161ad034bc2ee 1 parent a0cf7f4
Russell Keith-Magee authored May 10, 2010

Showing 1 changed file with 2 additions and 4 deletions. Show diff stats Hide diff stats

  1. 6  docs/ref/forms/validation.txt
6  docs/ref/forms/validation.txt
@@ -326,8 +326,6 @@ here and leaving it up to you and your designers to work out what works
326 326
 effectively in your particular situation. Our new code (replacing the previous
327 327
 sample) looks like this::
328 328
 
329  
-    from django.forms.util import ErrorList
330  
-
331 329
     class ContactForm(forms.Form):
332 330
         # Everything as before.
333 331
         ...
@@ -341,8 +339,8 @@ sample) looks like this::
341 339
                 # We know these are not in self._errors now (see discussion
342 340
                 # below).
343 341
                 msg = u"Must put 'help' in subject when cc'ing yourself."
344  
-                self._errors["cc_myself"] = ErrorList([msg])
345  
-                self._errors["subject"] = ErrorList([msg])
  342
+                self._errors["cc_myself"] = self.error_class([msg])
  343
+                self._errors["subject"] = self.error_class([msg])
346 344
 
347 345
                 # These fields are no longer valid. Remove them from the
348 346
                 # cleaned data.

0 notes on commit bc82e20

Please sign in to comment.
Something went wrong with that request. Please try again.