#27821: Documentation on form validation is wrong
---------------------------------------------+------------------------
               Reporter:  Christian Ullrich  |          Owner:  nobody
                   Type:  Bug                |         Status:  new
              Component:  Documentation      |        Version:  1.10
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 The documentation on form validation (/ref/forms/validation/) has this to
 say regarding the clean_<fieldname> method on a Form subclass:

     This method should return the cleaned value obtained from
 cleaned_data, regardless of whether it changed anything or not.

 This is incorrect; the method should return the value to be used for
 further processing, because its result is unconditionally put ''into''
 cleaned_data:

 (from django.forms.forms.Form._clean_fields():)
 {{{
 if hasattr(self, 'clean_%s' % name):
                     value = getattr(self, 'clean_%s' % name)()
                     self.cleaned_data[name] = value
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27821>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.8c48ebffcfdb0c4a872efdfbf60871d1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to