Skip to content
Myr

jinja django support is py 2.3 compatible now

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 4cc239a · Browse files · 1 file+5 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−6 removed

  • other:+5 added−6 removed

1 file+5 added−6 removed

modified:jinja/contrib/_djangosupport.py+5 added-6 removed
1# -*- coding: utf-8 -*-2# -*- coding: utf-8 -*-2"""3 jinja.contrib._djangosupport4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~5
129 unmodified lines
135 This is available in `django.contrib.jinja` as `register`.136137 For more details see the docstring of the `django.contrib.jinja` module.138 """140 @staticmethod139 def object(func, name=None):140 """Register a new global."""141 if name is None:142 name = getattr(func, '__name__')143 env.globals[name] = func144 return func145 object = staticmethod(object)146148 @staticmethod147 def filter(func, name=None):148 """Register a new filter function."""149 if name is None:150 name = func.__name__151 env.filters[name] = func152 return func153 filter = staticmethod(filter)154156 @staticmethod155 def test(func, name):156 """Register a new test function."""157 if name is None:158 name = func.__name__159 env.tests[name] = func160 return func161 test = staticmethod(test)162164 @staticmethod163 def context_inclusion(func, template, name=None):164 """165 Similar to the inclusion tag from django this one expects func to be a166 function with a similar argument list to func(context, *args, **kwargs)
15 unmodified lines
182 wrapper.__doc__ = func.__doc__183 except:184 pass185 env.globals[name] = wrapper186 context_inclusion = staticmethod(context_inclusion)187189 @staticmethod188 def clean_inclusion(func, template, name=None, run_processors=False):189 """190 Similar to above however it won't pass the context into func().191 Also the returned context will have the context processors run upon it.
13 unmodified lines
205 wrapper.__doc__ = func.__doc__206 except:207 pass208 env.globals[name] = wrapper209 clean_inclusion = staticmethod(clean_inclusion)