mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
[1.4.x] Fixed #14885 - Clarified that ModelForm cleaning may not fully complete if the form is invalid.
Thanks Ben Sturmfels for the patch.
Backport of 3fd89d9903
from master.
This commit is contained in:
parent
b05d2f51b8
commit
42aee6ffe5
1 changed files with 7 additions and 4 deletions
|
@ -200,10 +200,13 @@ The ``is_valid()`` method and ``errors``
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
The first time you call ``is_valid()`` or access the ``errors`` attribute of a
|
The first time you call ``is_valid()`` or access the ``errors`` attribute of a
|
||||||
``ModelForm`` triggers form validation as well as :ref:`model validation
|
``ModelForm`` triggers :ref:`form validation <form-and-field-validation>` as
|
||||||
<validating-objects>`. This has the side-effect of cleaning the model you pass
|
well as :ref:`model validation <validating-objects>`. This has the side-effect
|
||||||
to the ``ModelForm`` constructor. For instance, calling ``is_valid()`` on your
|
of cleaning the model you pass to the ``ModelForm`` constructor. For instance,
|
||||||
form will convert any date fields on your model to actual date objects.
|
calling ``is_valid()`` on your form will convert any date fields on your model
|
||||||
|
to actual date objects. If form validation fails, only some of the updates
|
||||||
|
may be applied. For this reason, you'll probably want to avoid reusing the
|
||||||
|
model instance.
|
||||||
|
|
||||||
|
|
||||||
The ``save()`` method
|
The ``save()`` method
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue