I am trying to create a form where you select product(s) and technology(s) and based on your selection different modules are available for selection.
forms.py def make_quiz_form_class(): #Listing available options products = [(i, _(i)) for i in Product.objects.all()] technologies = [(i, _(i)) for i in Technology.objects.all()] modules = [(i, _(i)) for i in Module.objects.filter(product=selected_products, technologies=selected_technologies)] class _QuizForm(forms.Form): selected_products = forms.ChoiceField(choices = products, widget=forms.RadioSelect()) selected_technologies = forms.ChoiceField(choices = technologies, widget=forms.RadioSelect()) selected_modules = forms.ChoiceField(choices = modules, widget=forms.RadioSelect()) return _QuizForm views.py form_class = make_quiz_form_class() form = form_class(request.POST) The problem is selected_products and selected_technologies are not defined for modules -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.