summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2011-09-10 02:42:05 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2011-09-10 02:42:05 +0000
commitd14bf8c62b66a6f58252d492c2eeca1c952e508c (patch)
tree43f97723196d29772bd9ef9f35e2c2af36c1d6de /docs
parent01b0eb50fd4a3503a80524f5fd783b0dba038105 (diff)
Fixed #11404. Added ``FormSet.has_changed``, for consistancy with ``Form.has_changed``. Thanks to michelts for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16773 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/forms/formsets.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt
index 50679a1a31..7912294dbb 100644
--- a/docs/topics/forms/formsets.txt
+++ b/docs/topics/forms/formsets.txt
@@ -150,6 +150,20 @@ As we can see, ``formset.errors`` is a list whose entries correspond to the
forms in the formset. Validation was performed for each of the two forms, and
the expected error message appears for the second item.
+We can also check if form data differs from the initial data (i.e. the form was
+sent without any data)::
+
+ >>> data = {
+ ... 'form-TOTAL_FORMS': u'1',
+ ... 'form-INITIAL_FORMS': u'0',
+ ... 'form-MAX_NUM_FORMS': u'',
+ ... 'form-0-title': u'',
+ ... 'form-0-pub_date': u'',
+ ... }
+ >>> formset = ArticleFormSet(data)
+ >>> formset.has_changed()
+ False
+
.. _understanding-the-managementform:
Understanding the ManagementForm