Loading docs/topics/forms/formsets.txt +2 −2 Original line number Diff line number Diff line Loading @@ -218,6 +218,7 @@ this management data, an exception will be raised:: ... 'form-0-pub_date': u'', ... } >>> formset = ArticleFormSet(data) >>> formset.is_valid() Traceback (most recent call last): ... django.forms.utils.ValidationError: [u'ManagementForm data is missing or has been tampered with'] Loading Loading @@ -474,8 +475,7 @@ Lets you create a formset with the ability to select forms for deletion:: ... {'title': u'Article #2', 'pub_date': datetime.date(2008, 5, 11)}, ... ]) >>> for form in formset: .... print(form.as_table()) <input type="hidden" name="form-TOTAL_FORMS" value="3" id="id_form-TOTAL_FORMS" /><input type="hidden" name="form-INITIAL_FORMS" value="2" id="id_form-INITIAL_FORMS" /><input type="hidden" name="form-MAX_NUM_FORMS" id="id_form-MAX_NUM_FORMS" /> ... print(form.as_table()) <tr><th><label for="id_form-0-title">Title:</label></th><td><input type="text" name="form-0-title" value="Article #1" id="id_form-0-title" /></td></tr> <tr><th><label for="id_form-0-pub_date">Pub date:</label></th><td><input type="text" name="form-0-pub_date" value="2008-05-10" id="id_form-0-pub_date" /></td></tr> <tr><th><label for="id_form-0-DELETE">Delete:</label></th><td><input type="checkbox" name="form-0-DELETE" id="id_form-0-DELETE" /></td></tr> Loading Loading
docs/topics/forms/formsets.txt +2 −2 Original line number Diff line number Diff line Loading @@ -218,6 +218,7 @@ this management data, an exception will be raised:: ... 'form-0-pub_date': u'', ... } >>> formset = ArticleFormSet(data) >>> formset.is_valid() Traceback (most recent call last): ... django.forms.utils.ValidationError: [u'ManagementForm data is missing or has been tampered with'] Loading Loading @@ -474,8 +475,7 @@ Lets you create a formset with the ability to select forms for deletion:: ... {'title': u'Article #2', 'pub_date': datetime.date(2008, 5, 11)}, ... ]) >>> for form in formset: .... print(form.as_table()) <input type="hidden" name="form-TOTAL_FORMS" value="3" id="id_form-TOTAL_FORMS" /><input type="hidden" name="form-INITIAL_FORMS" value="2" id="id_form-INITIAL_FORMS" /><input type="hidden" name="form-MAX_NUM_FORMS" id="id_form-MAX_NUM_FORMS" /> ... print(form.as_table()) <tr><th><label for="id_form-0-title">Title:</label></th><td><input type="text" name="form-0-title" value="Article #1" id="id_form-0-title" /></td></tr> <tr><th><label for="id_form-0-pub_date">Pub date:</label></th><td><input type="text" name="form-0-pub_date" value="2008-05-10" id="id_form-0-pub_date" /></td></tr> <tr><th><label for="id_form-0-DELETE">Delete:</label></th><td><input type="checkbox" name="form-0-DELETE" id="id_form-0-DELETE" /></td></tr> Loading