#21894: Error in example code in django.forms.Form.clean()¶
-----------------------------------+--------------------------------------
     Reporter:  richard.kellner@…  |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Documentation      |                  Version:  master
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------
Changes (by CarstenF):

 * status:  closed => new
 * resolution:  worksforme =>


Comment:

 Replying to [comment:1 bmispelon]:
 > Hi,
 >
 > The documentation is correct: this is a new feature in the development
 version of Django (soon-to-be 1.7), as described by the note under the
 example:
 >
 > > In previous versions of Django, form.clean() was required to return a
 dictionary of cleaned_data. This method may still return a dictionary of
 data to be used, but it’s no longer required.

 This however (referring to
 [https://docs.djangoproject.com/en/1.8/ref/forms/validation/#cleaning-and-
 validating-fields-that-depend-on-each-other this example code]), is
 inconsistent with the example code's statement
 {{{
 cleaned_data = super(ContactForm, self).clean()
 }}}
 about which a subsequent paragraph says:
 > Note that the call to `super(ContactForm, self).clean()` in the example
 code ensures that any validation logic in parent classes is maintained.

 That is, if the `clean()` method of the parent class is coded like the
 example code for the child, the example code won't work.

--
Ticket URL: <https://code.djangoproject.com/ticket/21894#comment:2>
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/086.8fc547bd308cfd149d8a5c85a325cdfd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to