The full problem statement involves multiple steps, however, at the heart of it is this simple scenario:
Lets say I have two forms
from django import forms
class Form1(forms.Form):
char_field1=forms.CharField(label='field 1')
char_field2=forms.CharField(label='field 2')
char_field3=forms.CharField(label='field 3')
class Form2(forms.Form):
choice_field = forms.ChoiceField()
Now using django.contrib.formtools.wizard.views.WizardView
or its subclass I would like to populate the choice_field with the options filled by the user in char_field1
- char_field3
.
I tried overriding the get_form
and populating the choice_field when Form2 was to be returned. It did show the options in the form rendered, but the form didn't validate upon submission.
My gut feel says that it should be possible, the 'how' is what I am not able to figure out.