Skip to content
Myr

tests.txt

This file

Path

docs/src/tests.txt

30 lines · 773 bytes

Last changed by

[svn] added block shortcut syntax for jinjaArmin Ronacherbefore adoption4965987

History of this file

Take it

The walk stopped after 200 commits: lines older than ca80b45 point at it.

[svn] fixed severe jinja memcaching bugArmin Ronacherbefore adoptionca80b45

lines 1–28why, one step back
1==============
2Test Functions3==============45In addition to filters, Jinja also supports test functions. Test functions6always return either ``True`` or ``False``. Inside the template they are available7using the `is` operator.89Jinja comes with some builtin tests listed in the `designer documentation`_.1011Writing Test Functions12======================1314Test functions look exactly like filters mentioned in the `filter documentation`_:1516.. sourcecode:: python1718 def is_even():19 def wrapped(env, context, value):20 return value % 2 == 021 return wrapped2223Now you have to register that test on an environment:2425.. sourcecode:: python2627 env.tests['even'] = is_even28

[svn] added block shortcut syntax for jinjaArmin Ronacherbefore adoption4965987

line 29why, one step back
29.. _designer documentation: builtins.txt

[svn] fixed severe jinja memcaching bugArmin Ronacherbefore adoptionca80b45

line 30why, one step back
30.. _filter documentation: filters.txt