summaryrefslogtreecommitdiff
path: root/docs/topics/forms
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2010-03-06 19:51:29 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2010-03-06 19:51:29 +0000
commitfa6c967438e8c22b63b3cc0ef71815525f15856a (patch)
treece7a314a03df8524b3aba6bda2bdf15cf18525b9 /docs/topics/forms
parent90616a77f0e7850ccb830d7d8533640f4dbf99db (diff)
Fixed #12896. Documented the new side-effects of ModelForm validation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12693 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/forms')
-rw-r--r--docs/topics/forms/modelforms.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt
index 96ed0ab544..9a64919534 100644
--- a/docs/topics/forms/modelforms.txt
+++ b/docs/topics/forms/modelforms.txt
@@ -196,6 +196,19 @@ we'll discuss in a moment.)::
name = forms.CharField(max_length=100)
authors = forms.ModelMultipleChoiceField(queryset=Author.objects.all())
+The ``is_valid()`` method and ``errors``
+----------------------------------------
+
+.. versionchanged:: 1.2
+
+The first time you call ``is_valid()`` or access the ``errors`` attribute of a
+``ModelForm`` has always triggered form validation, but as of Django 1.2, it
+will also trigger :ref:`model validation <validating-objects>`. This has the
+side-effect of cleaning the model you pass to the ``ModelForm`` constructor.
+For instance, calling ``is_valid()`` on your form will convert any date fields
+on your model to actual date objects.
+
+
The ``save()`` method
---------------------