Ticket #12001: 12001.diff

File 12001.diff, 1.0 KB (added by Tim Graham, 15 years ago)

ErrorList -> self.error_class

  • docs/ref/forms/validation.txt

     
    321321effectively in your particular situation. Our new code (replacing the previous
    322322sample) looks like this::
    323323
    324     from django.forms.util import ErrorList
    325 
    326324    class ContactForm(forms.Form):
    327325        # Everything as before.
    328326        ...
     
    336334                # We know these are not in self._errors now (see discussion
    337335                # below).
    338336                msg = u"Must put 'help' in subject when cc'ing yourself."
    339                 self._errors["cc_myself"] = ErrorList([msg])
    340                 self._errors["subject"] = ErrorList([msg])
     337                self._errors["cc_myself"] = self.error_class([msg])
     338                self._errors["subject"] = self.error_class([msg])
    341339
    342340                # These fields are no longer valid. Remove them from the
    343341                # cleaned data.
Back to Top