Built-in template tests used with the ``is`` operator.
Function | test |
Return true if the object is a boolean value. |
Function | test |
Return true if the variable is defined: |
Function | test |
Check if a variable is divisible by a number. |
Function | test |
Check if the value is escaped. |
Function | test |
Return true if the variable is even. |
Function | test |
Return true if the object is False. |
Function | test |
Check if a filter exists by name. Useful if a filter may be optionally available. |
Function | test |
Return true if the object is a float. |
Function | test |
Check if value is in seq. |
Function | test |
Return true if the object is an integer. |
Function | test |
Check if it's possible to iterate over an object. |
Function | test |
Return true if the variable is lowercased. |
Function | test |
Return true if the object is a mapping (dict etc.). |
Function | test |
Return true if the variable is none. |
Function | test |
Return true if the variable is a number. |
Function | test |
Return true if the variable is odd. |
Function | test |
Check if an object points to the same memory address than another object: |
Function | test |
Return true if the variable is a sequence. Sequences are variables that are iterable. |
Function | test |
Return true if the object is a string. |
Function | test |
Check if a test exists by name. Useful if a test may be optionally available. |
Function | test |
Return true if the object is True. |
Function | test |
Like :func:`defined` but the other way round. |
Function | test |
Return true if the variable is uppercased. |
Constant | TESTS |
Undocumented |
Return true if the variable is defined: .. sourcecode:: jinja {% if variable is defined %} value of variable: {{ variable }} {% else %} variable is not defined {% endif %} See the :func:`default` filter for a simple way to set undefined variables.
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Check if a filter exists by name. Useful if a filter may be optionally available. .. code-block:: jinja {% if 'markdown' is filter %} {{ value | markdown }} {% else %} {{ value }} {% endif %} .. versionadded:: 3.0
Parameters | |
env:Environment | Undocumented |
value:str | Undocumented |
Returns | |
bool | Undocumented |
Check if value is in seq. .. versionadded:: 2.10
Parameters | |
value:t.Any | Undocumented |
seq:t.Container | Undocumented |
Returns | |
bool | Undocumented |
Check if a test exists by name. Useful if a test may be optionally available. .. code-block:: jinja {% if 'loud' is test %} {% if value is loud %} {{ value|upper }} {% else %} {{ value|lower }} {% endif %} {% else %} {{ value }} {% endif %} .. versionadded:: 3.0
Parameters | |
env:Environment | Undocumented |
value:str | Undocumented |
Returns | |
bool | Undocumented |
Undocumented
Value |
|