Django FormWizard Multiple submissions against same form

58 Views Asked by At

I am using Djang FormWizard and have scenario where i have to do 1-to-Many save. I have one company and possibly many office holders. Since this is a web based form people can fill this differently. Your company can have 1 office holder and my company can have 10 office holders.

The number of forms is 3(for discussion sake).

1)First form is company detail 2)secondly form is office holders. 3)third form is a summary of what u have filled so far and a button asking if you want to add more office holders.

Using FormWizard i cant seem to figure out how to implement this. In in a regular scenarios i would have setup a link to the from 2, something like myurl.com?action=addmore and then rendered the form 2 accordingly

I can use wizard_goto_step in template to load form 2 but then i cant seem to figure out how to pass a conditional argument. Conditional argument will allow me to figure out that an additional office holders needs to be added and i then i can load a blank form 2. The conditional field cannot be a checkbox, has to be a button or a link. I do see how i can use button or link in this scenario?

Last resort i am thinking is load from by NamedURL and then check if i can pass the conditional argument can be passed in url(was hoping to avoid this, not really tried this also)

Any ideas?

1

There are 1 best solutions below

0
On

the solution is in implementing NamedUrlWizardView

https://django-formtools.readthedocs.io/en/latest/wizard.html#usage-of-namedurlwizardview

with NamedUrlWizardView you can send in name value pair in url

solved my problem.