[Answer]-Django Forms Manual Formatting

1👍

Here is one solution with a bit of hacking for the titles of the forms. if you would like to get rid of that I would recommend using python’s zip function in your view to combine the formset and a list of the titles. an example of doing that cand be found in this answer .

{{ formset.management_form }}
{% for form in formset %}
  <div class="span3" onTablet="span6" onDesktop="span3">
    <h2><b>
      {% if forloop.counter == 1 %}
        Application VM
      {% elif forloop.counter == 2 %}
        Router VM
      {% elif forloop.counter == 3 %}
        System VM
      {% endif %}
    </b></h2>
    <fieldset>
      {{ form.as_table }}
    </fieldset>
  </div>
{% endfor %}
👤Tim

Leave a comment