1๐
โ
I think I have this mostly working now with Django-Extra-Views.
My view looks like this:
class GuestEventInline(InlineFormSet):
model = GuestEvent
fields = [ 'attending', 'adults', 'children' ]
extra = 0
can_delete=False
class Invite2View(UpdateWithInlinesView):
template_name = "weddings/invite2.html"
model = Guest
inlines = [ GuestEventInline ]
And my template looks like this:
<form action="" method="post" class="form-horizontal">
{% csrf_token %}
{{ form }}
{% for formset in inlines %}
{{ formset.id }}
{{ formset.management_form}}
{%for subform in formset%}
<h4>{{ subform.instance.event }}</h4></a>
{{ subform.as_p }}
{% endfor %}
{% endfor %}
{% buttons submit='Save' %}{% endbuttons %}
</form>
๐คRedleader36
Source:stackexchange.com