Basically, what I'd like to do is take a formset that has been bounded to request.POST, add a blank form to it, and return the new formset.
class MyView(View):
def post(self, request):
MyFormSet = formset_factory(MyForm)
posted_formset = MyFormSet(request.POST)
# Append a blank form to posted_formset here
return render(request, 'mytemplate.html', {'formset': posted_formset})
Is there any clean way to do this in Django 1.6? Right now I've got a workaround that involves creating a new formset with initial
set to the data bound in posted_formset
, but it's kind of clunky, and I feel like there should be an easier way to do this.