def configure(self):
# process the parsed view variables
if 'path' not in self.vars:
raise MissingParameterError("Missing variable \"path\" in view: %s" % self.name)
self.path = self.vars['path']
# if it's a complex view
if isinstance(self.path, dict):
self.configure_complex_view(self.path)
elif isinstance(self.path, basestring):
self.configure_simple_view(self.path)
else:
raise ValueError("Unrecognised structure for \"path\" configuration in view: %s" % self.name)
# if we don't have a template yet
if self.template is None:
# try to load it
if 'template' not in self.vars:
raise MissingParameterError("Missing variable \"template\" in view: %s" % self.name)
self.template = self.template_engine.load_template(self.vars['template'])
self.configure_context()
评论列表
文章目录