コード例 #1
0
ファイル: templating.py プロジェクト: PritishC/nereid
 def value(self):
     """
     Return the rendered template with the current context
     """
     return flask_render_template(
         self.template_name_or_list, **self.context
     )
コード例 #2
0
ファイル: templating.py プロジェクト: trytonus/nereid
 def render(self):
     """
     Return the rendered template with the current context
     """
     return flask_render_template(
         self.template_name_or_list, **self.context
     )
コード例 #3
0
ファイル: templating.py プロジェクト: simmianand/nereid
def render_template(template_name, _prefix_website=True, **context):
    """Renders a template and by default adds the current website
    name as a prefix to the template name thereby allowing automatic
    name conversions from nereid base template to application specific
    templates
    """
    if _prefix_website:
        template_name = '%s/%s' % (
            request.nereid_website.name, template_name
        )
    return flask_render_template(template_name, **context)