0

別のテンプレート名を使用するためにフォーム ウィザードを使用しようとしていますが、単純なように見える理由がわからないエラーが表示されます。

フォームごとに異なるテンプレートを使用する

ビュー.py

from django.http import HttpResponseRedirect
from django.contrib.formtools.wizard.views import SessionWizardView

FORMS = [("customer", solution.forms.customerForm),  //got error undefined variables:solution 
     ("building", solution.forms.buildingForm)]

TEMPLATES = {"customer": "customer.html",
         "building": "building.html",
        }

class customerWizard(SessionWizardView):
def get_template_names(self):
    return [TEMPLATES[self.steps.current]]

def done(self, form_list, **kwargs):
    do_something_with_the_form_data(form_list) //get error undefined variables
    return HttpResponseRedirect('/page-to-redirect-to-when-done/')
4

1 に答える 1

1
from solution import forms *

FORMS = [
    ("customer", customerForm),  
    ("building", buildingForm)
]
于 2013-03-13T15:56:09.103 に答える