Get form from modelformset by the model associated in template
32 views
Skip to first unread message
Luigi Cirillo
unread,
Oct 30, 2014, 4:01:50 PM10/30/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hi Luigi,
Do you want something like this?
{%for form in modelformset %} Theobject:{{ form.instance }} The form:{{ form }} {% endform %}}
Collin
Luigi Cirillo
unread,
Nov 4, 2014, 7:02:59 AM11/4/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message