In a formwizard I want to use a custom query, based on previous choices. 
The form renders well, but when the step is submitted I get an "Select a 
valid choice. That choice is not one of the available choices." error

Here is the get_form part in my views.py (simplified):

    def get_form(self, step=None, data=None, files=None):
        form = super(BoekingWizard, self).get_form(step, data, files)
        if step == 'step3':
            form.fields['Activiteit'].queryset = Activiteit.objects.all()
           return form

Here is the part from my forms.py:

class BoekForm3(forms.Form):
    Activiteit = forms.ModelChoiceField(queryset=Activiteit.objects.none(), 
widget=forms.RadioSelect, empty_label=None)

Anybody an idea about this?

Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to