When I tried to figure out FormWizard, I looked for everything and found answers, such as most of them, that just say they donβt use it. FormPreview will work fine, since the OP is only interested in a single-level form, but the question remains valid in how to use FormWizard.
Despite the fact that this question is so old, I think it is useful to answer here, because this question is asked on so many sites, and I do not see any connecting answer to it, as well as a clear solution in the documents.
I think in terms of the OPs question, overriding process_step is the way to go. The trick is to create a form (or view) inside this method that will receive data from the first form.
I added this form_setup to my form.py as a utility wrapper (thought constructor):
def form_setup(**kwargs): def makeform(data, prefix=None, initial=None): form = FormLev2(data, prefix, initial) for k, v in kwargs.items(): if k == 'some_list': form.fields['some_list'].choices = v ... return form return makeform
Then override process_step as follows:
def process_step(self, request, process, step): if step == 1 if form.is_valid():
That way, you can dynamically change form_list (*) in the sense that you are changing form_list in an instance of FormWizard, not the form definitions themselves. The wrapper function is important for this function because it returns a function that will instantiate a new Form object, which is then used in FormWizard to call data for the next form and allows you to use the data from the previous one.
Edit: for Erik's comment and clarify the last part.
Also note that process_step will be called in step [0, n] after step n.