rr
2008-08-20 06:38:00 UTC
Hi Guru,
Depending on step 1's selection, I want to set the queryset of one of
the fields (a ModelChoiceField)
e.g.
class StepOneForm(forms.Form):
channelType =
forms.ModelChoiceField(queryset=ChannelType.objects.all())
class StepTwoForm(forms.Form):
channel = forms.ModelChoiceField()
class MyFormWizard(FormWizard):
def process_step(self, request, form, step):
if step==0:
self.get_form(1).channel.queryset =
form.cleaned_data['channelType'].channel_set.all()
But it doesn't seems working... how can a dynamic choice can be
achieved depending on selection of previous step?!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Depending on step 1's selection, I want to set the queryset of one of
the fields (a ModelChoiceField)
e.g.
class StepOneForm(forms.Form):
channelType =
forms.ModelChoiceField(queryset=ChannelType.objects.all())
class StepTwoForm(forms.Form):
channel = forms.ModelChoiceField()
class MyFormWizard(FormWizard):
def process_step(self, request, form, step):
if step==0:
self.get_form(1).channel.queryset =
form.cleaned_data['channelType'].channel_set.all()
But it doesn't seems working... how can a dynamic choice can be
achieved depending on selection of previous step?!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-***@googlegroups.com
To unsubscribe from this group, send email to django-users+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---