Constant | TESTS |
Undocumented |
Function | test_boolean |
Return true if the object is a boolean value. |
Function | test_defined |
Return true if the variable is defined: |
Function | test_divisibleby |
Check if a variable is divisible by a number. |
Function | test_escaped |
Check if the value is escaped. |
Function | test_even |
Return true if the variable is even. |
Function | test_false |
Return true if the object is False. |
Function | test_filter |
Check if a filter exists by name. Useful if a filter may be optionally available. |
Function | test_float |
Return true if the object is a float. |
Function | test_in |
Check if value is in seq. |
Function | test_integer |
Return true if the object is an integer. |
Function | test_iterable |
Check if it's possible to iterate over an object. |
Function | test_lower |
Return true if the variable is lowercased. |
Function | test_mapping |
Return true if the object is a mapping (dict etc.). |
Function | test_none |
Return true if the variable is none. |
Function | test_number |
Return true if the variable is a number. |
Function | test_odd |
Return true if the variable is odd. |
Function | test_sameas |
Check if an object points to the same memory address than another object: |
Function | test_sequence |
Return true if the variable is a sequence. Sequences are variables that are iterable. |
Function | test_string |
Return true if the object is a string. |
Function | test_test |
Check if a test exists by name. Useful if a test may be optionally available. |
Function | test_true |
Return true if the object is True. |
Function | test_undefined |
Like defined but the other way round. |
Function | test_upper |
Return true if the variable is uppercased. |
Undocumented
Value |
|
Return true if the object is a boolean value.
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Return true if the variable is defined:
{% if variable is defined %} value of variable: {{ variable }} {% else %} variable is not defined {% endif %}
See the default
filter for a simple way to set undefined
variables.
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:int | Undocumented |
num:int | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:int | Undocumented |
Returns | |
bool | Undocumented |
Return true if the object is False.
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Check if a filter exists by name. Useful if a filter may be optionally available.
{% if 'markdown' is filter %} {{ value | markdown }} {% else %} {{ value }} {% endif %}
Parameters | |
env:Environment | Undocumented |
value:str | Undocumented |
Returns | |
bool | Undocumented |
Return true if the object is a float.
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Check if value is in seq.
Parameters | |
value:t.Any | Undocumented |
seq:t.Container | Undocumented |
Returns | |
bool | Undocumented |
Return true if the object is an integer.
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:str | Undocumented |
Returns | |
bool | Undocumented |
Return true if the object is a mapping (dict etc.).
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:int | Undocumented |
Returns | |
bool | Undocumented |
Check if an object points to the same memory address than another object:
{% if foo.attribute is sameas false %} the foo attribute really is the `False` singleton {% endif %}
Parameters | |
value:t.Any | Undocumented |
other:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |
Check if a test exists by name. Useful if a test may be optionally available.
{% if 'loud' is test %} {% if value is loud %} {{ value|upper }} {% else %} {{ value|lower }} {% endif %} {% else %} {{ value }} {% endif %}
Parameters | |
env:Environment | Undocumented |
value:str | Undocumented |
Returns | |
bool | Undocumented |
Return true if the object is True.
Parameters | |
value:t.Any | Undocumented |
Returns | |
bool | Undocumented |