Django SessionWizardView doesn't execute done method

我们两清 提交于 2019-12-05 21:32:06

Try sending the user directly to a html page. In this case change page_i_want_to_send_user.html to the name of the page you want the user to be sent to after they complete the form

class CvWizardView(CookieWizardView):
    form_list = [InfoPersonalForm, PresentacionForm]
    template_name = 'postulantes/cv_wizard.html'

     def done(self, form_list, **kwargs):  
            return render_to_response('page_i_want_to_send_user.html', {
                'form_data': [form.cleaned_data for form in form_list],            
            }) 

In this case the page_i_want_to_send_user.html page is stored inside the templates directory

You may have a field validation error. Try adding the lines,

{{ wizard.form.non_field_errors }}
{{ wizard.form.errors }}

after the line,

{{ wizard.management_form }}

in your html template file. That should display any validation errors which are preventing the done method from executing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!