{{{
# Always return the full collection of cleaned data.
return cleaned_data
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21894>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0
Comment:
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/21894#comment:1>
* 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>
* Attachment "21894.diff" added.
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/21894#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"80855a4b3787bace050a8b4a2b80f79306e69812" 80855a4]:
{{{
#!CommitTicketReference repository=""
revision="80855a4b3787bace050a8b4a2b80f79306e69812"
Fixed #21894 -- Corrected a form.clean() example in case a superclass
doesn't return data.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21894#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"6861c2027da87cd9606cef8530e738613bb8c293" 6861c20]:
{{{
#!CommitTicketReference repository=""
revision="6861c2027da87cd9606cef8530e738613bb8c293"
[1.8.x] Fixed #21894 -- Corrected a form.clean() example in case a
superclass doesn't return data.
Backport of 80855a4b3787bace050a8b4a2b80f79306e69812 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21894#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"55ed23fd3e17c7743252a967a8f9957e038d35c4" 55ed23fd]:
{{{
#!CommitTicketReference repository=""
revision="55ed23fd3e17c7743252a967a8f9957e038d35c4"
[1.9.x] Fixed #21894 -- Corrected a form.clean() example in case a
superclass doesn't return data.
Backport of 80855a4b3787bace050a8b4a2b80f79306e69812 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21894#comment:6>