diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2010-05-10 14:16:04 +0000 |
---|---|---|
committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-05-10 14:16:04 +0000 |
commit | a0ea98e7a0c455e44bed2b79abe5f20b106bdd34 (patch) | |
tree | f3df66434e5cbe64d3167f573c2c47983072be57 | |
parent | 45f5e0c980bd0e6387f5d4041677a027677fb785 (diff) | |
download | django-a0ea98e7a0c455e44bed2b79abe5f20b106bdd34.tar.gz |
[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.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@13226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r-- | docs/ref/forms/validation.txt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/docs/ref/forms/validation.txt b/docs/ref/forms/validation.txt index 6f5041f699..ae538916d7 100644 --- a/docs/ref/forms/validation.txt +++ b/docs/ref/forms/validation.txt @@ -260,8 +260,6 @@ here and leaving it up to you and your designers to work out what works 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 @@ sample) looks like this:: # 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. |