Ticket #11908: 11908.diff
File 11908.diff, 1.2 KB (added by , 15 years ago) |
---|
-
docs/topics/forms/formsets.txt
122 122 Understanding the ManagementForm 123 123 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 124 124 125 You may have noticed the additional data that was required in the formset's126 data above. This data is coming from the ``ManagementForm``. This form is 127 dealt with internally to the formset. If you don't use it, it will result in 128 an exception::125 You may have noticed the additional data (``form-TOTAL_FORMS`` and 126 ``form-INITIAL_FORMS``) that was required in the formset's data above. This data 127 is coming from the ``ManagementForm``. This form is dealt with internally to the 128 formset. If you don't use it, it will result in an exception:: 129 129 130 130 >>> data = { 131 131 ... 'form-0-title': u'Test', … … 138 138 139 139 It is used to keep track of how many form instances are being displayed. If 140 140 you are adding new forms via JavaScript, you should increment the count fields 141 in this form as well. 141 in this form as well. The easiest way to add this data to your form is to 142 include ``{{ formset.management_form }}`` in your template. 142 143 143 144 .. versionadded:: 1.1 144 145