Answer the question
In order to leave comments, you need to log in
Is it possible to call as_view from a controller?
Is it possible to call as_view() of a class from a controller?
I need to pass a variable that is initialized in the controller.
This is what routing looks like
urlpatterns = [
path('form/check/', room_check, name='room_check'),
path('contact/', BookWizard.as_view(FORMS, initial_dict=initial)),
]
initial = {
'0': {'check_in_date': check_in_date,
'date_of_eviction': date_of_eviction,
'category': category,
'number_of_adults': number_of_adults,
'number_of_children': number_of_children}}
return redirect(BookWizard.as_view(FORMS, initial_dict=initial))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question