Open kulbir opened 8 years ago
So a couple things come to mind.
First, you don't describe your template, but nested formset doesn't "magically" work like a normal form -- you have to iterate on over the nested forms. See nested-formset/demo/blocks/templates/blocks/building_form.html
for an example of that in an update form.
Second (and probably more importantly for you), I don't believe that nested formsets don't support creating the "root" object along with children and grandchildren all in one go. Looking at the tests, they all start with a root object created ahead of time. My recollection is that the thing that's missing is attaching the ID
of the newly created root object to its children at save time.
I'm not actively working on nested formsets these days, but I'd be happy to review a PR with tests if you wanted to add this.
Hi, How do I create nested-formset with
CreateView
? I tried your example. But that code does not showEmployee
's form. Am I missing something? ThanksHere are my models
My View