I want to customize the layout of the forms in the form set (that is, I do not want to use .as_table () or .as_p (), etc.). I am trying to get the name of a form field to use in its label for, but I'm not sure how to do it. I hope that I will not need to create a new name / identifier for the field from scratch. Here is an example of what I'm working with right now:
{% for form in formset.forms %}
<label for="{{what do I put here?}}">{{form.fields.path.label}}:</label><input type="text" id="{{django creates this one; do I have to do my own with the for loop counter or something?}}" name="{{probably the same as id}}" />
{% endfor %}
Is there any type of "create an identifier for a form set field"?
source
share