I would like to determine which forms within a formset are new forms
and which forms are existing forms.

For example if I create a formset with extra=3, I would like to put
the 3 extra forms into a seperate fieldset for readability reasons.

I have tried building some logic into the template but I'm having no
luck so far.

Can anyone help out?


<form method="POST" action="">
    <fieldset>
        <legend>Edit Domain</legend>
        {{ form.as_table }}
    </fieldset>

    {{ dns_formset.management_form }}
    <fieldset>
        <legend>Edit DNS Records</legend>
        {% for form in dns_formset.forms %}
                {% ifnotequal form.required_data_field.value '' %}
                        {{ form.as_table }}
                {% endifnotequal %}
        {% endfor %}
    </fieldset>
    <fieldset>
        <legend>Create DNS Records</legend>
        {% for form in dns_formset.forms %}
                {% ifequal form.required_data_field.value '' %}
                        {{ form.as_table }}
                {% endifequal %}
        {% endfor %}
    </fieldset>
    <input type="submit" value="Submit" />
</form>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to