Answer the question
In order to leave comments, you need to log in
How to display the first step django.formtool.wizard on all pages of the site?
The site has a booking form. Broken down into three stages.
I have a wizard defined
class OrderWizard(SessionWizardView):
template_name = 'order/form.html'
form_list = [OrderForm1, OrderForm2, OrderForm3]
def left_order_form(request):
if request.path != reverse('excursion_order') :
wizard = OrderWizard()
else :
wizard = None
return {
'left_col_wizard': wizard
}
{{ left_col_wizard.form }}
Answer the question
In order to leave comments, you need to log in
Instead of passing a class, it was necessary to generate a TemplateResponse and select the wizard object from it. Thanks to Rostislav Grigoriev for the solution!
def left_order_form(request):
if request.path != reverse('excursion_order') :
wizard = OrderWizard.as_view()(request).context_data['wizard']
else :
wizard = None
return {
'left_col_wizard': wizard
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question