编辑: FWIW,我正在运行 django 1.3
我有...
class CreateProductWizard(FormWizard):
def get_template(self, step):
if step == 1:
return 'product/form_wizard/editor.html'
else:
return 'product/form_wizard/wizard_%s.html' % step
def process_step(self, request, form, step):
if step == 1:
self.extra_context = {'ptype': form.cleaned_data}
return
else:
return
def done(self, request, form_list):
# now that it's all together, store it.
return render_to_response('product/form_wizard/done.html',
{'form_data': [form.cleaned_data for form in form_list]},
context_instance=RequestContext(request))
我想将 self.extra_context 放到模板中。
我如何在模板上获得它?
我在模板上试过:
{{extra_context}}
{{form.extra_context}}
{{form.extra_context.ptype}}
ETC..