{{{
form.is_valid()
if form.cleaned_data.get('cancel'):
...
}}}
We did not understand why `form.is_valid()` is necessary.
It seems that `form.cleaned_data` is not a property, you need to call
`is_valid()` first.
It would be nice if `Form.cleaned_data` is be a property, this way the
following code would just work:
{{{
if form.cleaned_data.get('cancel'):
...
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26259>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => wontfix
* component: Uncategorized => Forms
* needs_tests: => 0
* needs_better_patch: => 0
* needs_docs: => 0
* type: Uncategorized => New feature
Comment:
I don't think an implicit call to `is_valid()` is a good idea. Most of the
time, you do want different handling for valid and invalid forms. Of
course, you could write your own subclass of `Form` which has the behavior
you desire.
Feel free to raise the idea on the DevelopersMailingList for other
opinions.
--
Ticket URL: <https://code.djangoproject.com/ticket/26259#comment:1>