views:

43

answers:

3

For the documentation, I'm able to display a formset as below

<table>
    {{ formset }}
</table>

However, what if I want to format the layout manually? Like how it's done for ModelForms? How can I achieve this?

+3  A: 

You can do form.field name, Example: {{ form.username }}, django-display form template

Prashanth
+1  A: 
{% for form in formset %}
   {% for field in form %}
       do something with {{ field }}
   {% endfor %}
{% endfor %}
Daniel Roseman
Just went through the docs again...almost beat myself when it finally hit me...got the same solution as you Daniel so thank you.
Stephen
+1  A: 

I do something like this.

{{ form.username.errors }}
<label for="id_username">Username:</label>
{{ form.username }}<br />

{{ form.password.errors }}
<label for="id_password">Password:</label>
{{ form.password }}

Or you could do if you didn't need to customize the label element

{{ field.username_tag }}: {{ form.username}}
silent1mezzo