From a0bae6ebb8105bfe649b21b001ab0b19dce59b2c Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 1 Feb 2010 14:19:30 +0000 Subject: [PATCH] Updated formset docs to contain the new management form field for max_num values. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12373 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/topics/forms/formsets.txt | 6 +++++- docs/topics/forms/modelforms.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index 6149290d2e..3fb2b0af16 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -102,6 +102,7 @@ provide an invalid article:: >>> data = { ... 'form-TOTAL_FORMS': u'2', ... 'form-INITIAL_FORMS': u'0', + ... 'form-MAX_NUM_FORMS': u'0', ... 'form-0-title': u'Test', ... 'form-0-pub_date': u'16 June 1904', ... 'form-1-title': u'Test', @@ -189,6 +190,7 @@ is where you define your own validation that works at the formset level:: >>> data = { ... 'form-TOTAL_FORMS': u'2', ... 'form-INITIAL_FORMS': u'0', + ... 'form-MAX_NUM_FORMS': u'0', ... 'form-0-title': u'Test', ... 'form-0-pub_date': u'16 June 1904', ... 'form-1-title': u'Test', @@ -247,6 +249,7 @@ happen when the user changes these values:: >>> data = { ... 'form-TOTAL_FORMS': u'3', ... 'form-INITIAL_FORMS': u'2', + ... 'form-MAX_NUM_FORMS': u'0', ... 'form-0-title': u'Article #1', ... 'form-0-pub_date': u'2008-05-10', ... 'form-0-ORDER': u'2', @@ -284,7 +287,7 @@ Lets create a formset with the ability to delete:: ... ]) >>> for form in formset.forms: .... print form.as_table() - + @@ -302,6 +305,7 @@ delete fields you can access them with ``deleted_forms``:: >>> data = { ... 'form-TOTAL_FORMS': u'3', ... 'form-INITIAL_FORMS': u'2', + ... 'form-MAX_NUM_FORMS': u'0', ... 'form-0-title': u'Article #1', ... 'form-0-pub_date': u'2008-05-10', ... 'form-0-DELETE': u'on', diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index 1269dd030c..96ed0ab544 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -544,7 +544,7 @@ with the ``Author`` model. It works just like a regular formset:: >>> formset = AuthorFormSet() >>> print formset - +