示例#1
0
 def render(self, template_name, **args):
     template_class = make_slug(template_name)
     if not os.path.splitext(template_name)[1]:
         template_name += '.html'
     tmpl = self.app.jinja_env.get_template(
         template_name,
         globals=dict(
             req=self.req,
             handler=self,
             app_config=self.app,
             sorted=sorted,
             isinstance=isinstance,
             list=list,
             app_html=self.app_html,
             format_description=format_description,
             template_class=template_class,
             format_date=self.format_date))
     return tmpl.render(**args)
示例#2
0
 def set_slug(self):
     self.slug = make_slug(self.name)