[Answer]-Django Form Wizard BooleanFields always returning False


Sorry I gave you the wrong field class. Instead MultipleChoiceField it should be ModelMultipleChoiceField, since you select from models.

Something like this works in my case:

forms.py (form for first step)

class FirstStepForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(FirstStepForm, self).__init__(*args, **kwargs)
        self.fields['countries'] = forms.ModelMultipleChoiceField(queryset=Country.objects.all())


class MyWizard(SessionWizardView):
    def render(self, form=None, **kwargs):
        response = super(MyWizard, self).render(form, **kwargs)

        grids_data = self.get_cleaned_data_for_step('0') or {}
        print grids_data

        return response

Leave a comment