SessionWizardView를 작동시킬 수 없습니다. 마지막 단계를 제출하면 마법사가 첫 번째 단계로 돌아가서 done 메서드를 실행하지 않습니다.Django SessionWizardView가 done 메소드를 실행하지 않습니다.
views.py
class CvWizardView(CookieWizardView):
form_list = [InfoPersonalForm, PresentacionForm]
template_name = 'postulantes/cv_wizard.html'
def done(self, form_list, **kwargs):
return HttpResponseRedirect(reverse('wizard_done'))
urls.py
url(r'^wizard/$', CvWizardView.as_view() , name="wizard"),
HTML
{% extends "base.html" %}
{% load i18n %}
{% block extra_head %}
{{ wizard.form.media }}
{% endblock %}
{% block content %}
<p>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</p>
<form action="" method="post">{% csrf_token %}
<table>
{{ wizard.management_form }}
{% if wizard.form.forms %}
{{ wizard.form.management_form }}
{% for form in wizard.form.forms %}
{{ form }}
{% endfor %}
{% else %}
{{ wizard.form }}
{% endif %}
</table>
{% if wizard.steps.prev %}
<button name="wizard_goto_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
<button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
{% endif %}
<input type="submit" value="{% trans "submit" %}"/>
</form>
{% endblock %}
감사합니다!
'done()'메서드가 호출되지 않았다는 것을 어떻게 알 수 있습니까? 'wizard_done' url이란 무엇입니까? – Rohan