Get form from modelformset by the model associated in template

28 views
Skip to first unread message

Luigi Cirillo

unread,
Oct 30, 2014, 4:01:50 PM10/30/14
to django...@googlegroups.com
Hi all,
I think it is a simple question but I don't know how I can get the specific form associated to a model from a modelformset inside a template.
In other words I am extending a ListView and I pass a modelformset through the context.
So in the template:
{% for object in object_list %}
    {{ object.field }}
    {{ which form of modelformset????? }}
{% endfor %}

Thank you,
Luigi

Collin Anderson

unread,
Nov 2, 2014, 8:14:53 PM11/2/14
to django...@googlegroups.com
Hi Luigi,

Do you want something like this?

{% for form in modelformset %}
   
The object: {{ form.instance }}
   
The form: {{ form }}
{% endform %}}

Collin

Luigi Cirillo

unread,
Nov 4, 2014, 7:02:59 AM11/4/14
to django...@googlegroups.com
Yes, thank you Collin
Reply all
Reply to author
Forward
0 new messages