:py:mod:`core.render.html.utils`
================================
.. py:module:: core.render.html.utils
Module Contents
---------------
Functions
~~~~~~~~~
.. autoapisummary::
core.render.html.utils.getGlobalFunctions
core.render.html.utils.getGlobalFilters
core.render.html.utils.getGlobalTests
core.render.html.utils.getGlobalExtensions
core.render.html.utils.jinjaGlobalFunction
core.render.html.utils.jinjaGlobalFilter
core.render.html.utils.jinjaGlobalTest
core.render.html.utils.jinjaGlobalExtension
Attributes
~~~~~~~~~~
.. autoapisummary::
core.render.html.utils.__jinjaGlobals_
core.render.html.utils.__jinjaFilters_
core.render.html.utils.__jinjaTests_
core.render.html.utils.__jinjaExtensions_
.. py:data:: __jinjaGlobals_
.. py:data:: __jinjaFilters_
.. py:data:: __jinjaTests_
.. py:data:: __jinjaExtensions_
:value: []
.. py:function:: getGlobalFunctions()
.. py:function:: getGlobalFilters()
.. py:function:: getGlobalTests()
.. py:function:: getGlobalExtensions()
.. py:function:: jinjaGlobalFunction(f)
Decorator, marks a function as a Jinja2 global.
.. py:function:: jinjaGlobalFilter(f)
Decorator, marks a function as a Jinja2 filter.
.. py:function:: jinjaGlobalTest(func_or_alias)
Decorator, marks a function as a Jinja2 test.
To avoid name conflicts you can call the decorator
with an alias as first argument.
Otherwise, the test will be registered under the function name.
.. code-block:: python
# Example:
from viur.core.render.html import jinjaGlobalTest
# @jinjaGlobalTest # available under "positive_number"
@jinjaGlobalTest("positive") # available under "positive"
def positive_number(render, value):
return isinstance(value, int) and value > 0
.. py:function:: jinjaGlobalExtension(ext)
Function for activating extensions in Jinja2.