Login

InlineFormset Template

Author:
petry
Posted:
November 12, 2008
Language:
HTML/template
Version:
Not specified
Tags:
template form formset inline
Score:
0 (after 0 ratings)

Field used to cutomize inline formset

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{%for f in form.management_form%}
    {{f}}
{%endfor%}
<table>
    <tr>
    {% for field in form.forms.0 %}
        {% if not field.is_hidden %}
            <th>{{field.label}}</th>
        {% endif %}
    {% endfor %}
    </tr>
    {%for f in form.forms%}
        <tr>
        {%for field in f%} 
            {% if not field.is_hidden %}
                <td valign="bottom">{{field}}</td>
            {%else%}
                {{field}}
            {% endif %}
        {%endfor%}
        </tr>
    {%endfor%}
</table>

More like this

  1. Making a django inline (model) formset really tabular by fnl 5 years, 11 months ago
  2. Printing inline formsets as UL / P by ikke 5 years, 7 months ago
  3. Embedded inline formsets in ModelForm by stan 4 years, 4 months ago
  4. Different number of extra formsets in add/change view of ModelAdmin. by xormag 3 years, 8 months ago
  5. Dynamical formsets by I159 3 years, 4 months ago

Comments

Please login first before commenting.