Exemple #1
0
 def value(self):
     """
     Return the rendered template with the current context
     """
     return flask_render_template(
         self.template_name_or_list, **self.context
     )
Exemple #2
0
 def render(self):
     """
     Return the rendered template with the current context
     """
     return flask_render_template(
         self.template_name_or_list, **self.context
     )
Exemple #3
0
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)