I am constructing the pieces of a formset manually in a template. How do I get the hidden fields TOTAL_FORMS and INITIAL_FORMS. Is there a hidden display widget with them in it already there that I can call?
<label>formset title</label>
#formset.TOTAL_FORMS
#formset.INITIAL_FORMS
{% for form in formset.forms %}
{{form.field}}
{{form.id}}
{% endfor %}
You can also shortcut that by just outputting the management form, which consists of those two hidden fields:
I didn’t properly cite this info, which can be found at: http://docs.djangoproject.com/en/dev/topics/forms/formsets/