class ExchangeRate(StampedModel):
document = models.ForeignKey(DocExchangeRate)
# another fields
ExchangeInlineFormset = inlineformset_factory(DocExchangeRate, ExchangeRate, fk_name='document', extra=1)
class DocExchangeRateCreateView(CreateView):
model = DocExchangeRate
def get(self, request, *args, **kwargs):
from django.shortcuts import render
self.object = None
formset = ExchangeInlineFormset()
return render(request, 'pricing/docexchangerate_form.html', self.get_context_data(formset=formset))
<form action="" method="post">{% csrf_token %}
{{ form }}
{{ formset.management_form }}
{{ formset }}
<input type="submit" class="submit"/>
</form>
рендерится inline formset, а после нажатия submit - основная форма. Как вывести их вместе?