# -*- coding: utf-8 -*-\r
-# -*- coding: utf-8 -*-\r
"""\r
jinja.contrib._djangosupport\r
~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
\r
For more details see the docstring of the `django.contrib.jinja` module.\r
"""\r
- @staticmethod\r
def object(func, name=None):\r
"""Register a new global."""\r
if name is None:\r
name = getattr(func, '__name__')\r
env.globals[name] = func\r
return func\r
+ object = staticmethod(object)\r
\r
- @staticmethod\r
def filter(func, name=None):\r
"""Register a new filter function."""\r
if name is None:\r
name = func.__name__\r
env.filters[name] = func\r
return func\r
+ filter = staticmethod(filter)\r
\r
- @staticmethod\r
def test(func, name):\r
"""Register a new test function."""\r
if name is None:\r
name = func.__name__\r
env.tests[name] = func\r
return func\r
+ test = staticmethod(test)\r
\r
- @staticmethod\r
def context_inclusion(func, template, name=None):\r
"""\r
Similar to the inclusion tag from django this one expects func to be a\r
except:\r
pass\r
env.globals[name] = wrapper\r
+ context_inclusion = staticmethod(context_inclusion)\r
\r
- @staticmethod\r
def clean_inclusion(func, template, name=None, run_processors=False):\r
"""\r
Similar to above however it won't pass the context into func().\r
except:\r
pass\r
env.globals[name] = wrapper\r
+ clean_inclusion = staticmethod(clean_inclusion)\r