Ticket #3749: FilterNode.2.patch
File FilterNode.2.patch, 1.3 KB (added by , 18 years ago) |
---|
-
django/template/defaulttags.py
41 41 def render(self, context): 42 42 output = self.nodelist.render(context) 43 43 # apply filters 44 return self.filter_expr.resolve(Context({'var': output})) 44 context.update({'var': output}) 45 filtered = self.filter_expr.resolve(context) 46 context.pop() 47 return filtered 45 48 46 49 class FirstOfNode(Node): 47 50 def __init__(self, vars): -
tests/regressiontests/templates/tests.py
259 259 'filter01': ('{% filter upper %}{% endfilter %}', {}, ''), 260 260 'filter02': ('{% filter upper %}django{% endfilter %}', {}, 'DJANGO'), 261 261 'filter03': ('{% filter upper|lower %}django{% endfilter %}', {}, 'django'), 262 'filter04': ('{% filter cut:remove %}djangospam{% endfilter %}', {'remove': 'spam'}, 'django'), 262 263 263 264 ### FIRSTOF TAG ########################################################### 264 265 'firstof01': ('{% firstof a b c %}', {'a':0,'b':0,'c':0}, ''),