![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Functions | |
| bool | test_odd (int value) |
| bool | test_even (int value) |
| bool | test_divisibleby (int value, int num) |
| bool | test_defined (t.Any value) |
| bool | test_undefined (t.Any value) |
| bool | test_filter ("Environment" env, str value) |
| bool | test_test ("Environment" env, str value) |
| bool | test_none (t.Any value) |
| bool | test_boolean (t.Any value) |
| bool | test_false (t.Any value) |
| bool | test_true (t.Any value) |
| bool | test_integer (t.Any value) |
| bool | test_float (t.Any value) |
| bool | test_lower (str value) |
| bool | test_upper (str value) |
| bool | test_string (t.Any value) |
| bool | test_mapping (t.Any value) |
| bool | test_number (t.Any value) |
| bool | test_sequence (t.Any value) |
| bool | test_sameas (t.Any value, t.Any other) |
| bool | test_iterable (t.Any value) |
| bool | test_escaped (t.Any value) |
| bool | test_in (t.Any value, t.Container[t.Any] seq) |
Variables | |
| dict | TESTS |
Built-in template tests used with the ``is`` operator.
| bool jinja2.tests.test_boolean | ( | t.Any | value | ) |
Return true if the object is a boolean value. .. versionadded:: 2.11
| bool jinja2.tests.test_defined | ( | t.Any | value | ) |
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.
| bool jinja2.tests.test_divisibleby | ( | int | value, |
| int | num | ||
| ) |
Check if a variable is divisible by a number.
| bool jinja2.tests.test_escaped | ( | t.Any | value | ) |
Check if the value is escaped.
| bool jinja2.tests.test_even | ( | int | value | ) |
Return true if the variable is even.
| bool jinja2.tests.test_false | ( | t.Any | value | ) |
Return true if the object is False. .. versionadded:: 2.11
| bool jinja2.tests.test_filter | ( | "Environment" | env, |
| str | value | ||
| ) |
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
| bool jinja2.tests.test_float | ( | t.Any | value | ) |
Return true if the object is a float. .. versionadded:: 2.11
| bool jinja2.tests.test_in | ( | t.Any | value, |
| t.Container[t.Any] | seq | ||
| ) |
Check if value is in seq. .. versionadded:: 2.10
| bool jinja2.tests.test_integer | ( | t.Any | value | ) |
Return true if the object is an integer. .. versionadded:: 2.11
| bool jinja2.tests.test_iterable | ( | t.Any | value | ) |
Check if it's possible to iterate over an object.
| bool jinja2.tests.test_lower | ( | str | value | ) |
Return true if the variable is lowercased.
| bool jinja2.tests.test_mapping | ( | t.Any | value | ) |
Return true if the object is a mapping (dict etc.). .. versionadded:: 2.6
| bool jinja2.tests.test_none | ( | t.Any | value | ) |
Return true if the variable is none.
| bool jinja2.tests.test_number | ( | t.Any | value | ) |
Return true if the variable is a number.
| bool jinja2.tests.test_odd | ( | int | value | ) |
Return true if the variable is odd.
| bool jinja2.tests.test_sameas | ( | t.Any | value, |
| t.Any | other | ||
| ) |
Check if an object points to the same memory address than another
object:
.. sourcecode:: jinja
{% if foo.attribute is sameas false %}
the foo attribute really is the `False` singleton
{% endif %}
| bool jinja2.tests.test_sequence | ( | t.Any | value | ) |
Return true if the variable is a sequence. Sequences are variables that are iterable.
| bool jinja2.tests.test_string | ( | t.Any | value | ) |
Return true if the object is a string.
| bool jinja2.tests.test_test | ( | "Environment" | env, |
| str | value | ||
| ) |
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
| bool jinja2.tests.test_true | ( | t.Any | value | ) |
Return true if the object is True. .. versionadded:: 2.11
| bool jinja2.tests.test_undefined | ( | t.Any | value | ) |
Like :func:`defined` but the other way round.
| bool jinja2.tests.test_upper | ( | str | value | ) |
Return true if the variable is uppercased.