-
-
Notifications
You must be signed in to change notification settings - Fork 12
Templating Reference
For syntax, refer to Django's documentation.
Sets the autoescaping mode. mode may be one of 'off', 'html', 'js-string', 'csv', or to restore the previous mode 'end'.
Applies filters to the contained template until {% endfilter %}
. filters uses templating syntax, without the variable path or the preceding |
.
Finds the first value of variables... that is truthy.
Evaluates the contained template until {% endfor %}
(or {% empty %}
) for each item contained in variable. Each time it assigns the item to value (which must be a global name), and the corrosponding key to key.
Evaluates the contained template until {% endfor %}
if there are no items in variable.
Evaluates the condition, and if truthy evaluates the contained template until {% endif %}
(or {% else %}
or {% elif %}
). The condition is a variable, or variables with infix operators (documented next) between them. Spaces are required between variables and operators.
In order of precedance (lowest binding to highest binding):
or
and
-
not
(prefix) -
<
,>
,<=
,>=
,==
,!=
,in
Any operator may be prefixed with not to negate it (only really useful for in
).
If the expression evaluated to something falsy, evaluates the contained template until {% endif %}
.
If the expression evaluated to something falsy and the contained template until the next {% elif %}
or {% endif %}
.
Checks if any of the variables have changed since the last time this code was run. If so it runs the embedded template until {% endif %}
(or {% else %}
).
Evaluates if there are no changes.
Outputs the time, formatted as per format. See Vala's documentation for how to write format strings.
As per Django.
Translates the contained template until {% endtrans %}
(or {% plural %}
), possibly using the additional variables specified in the tag. It is courtious to avoid markup and templating where possible within the the body of a trans tag. A preceding comment within this template will be split out specially for translators.
Evaluates (in English) if the count
variable indicates the plural form should be used.
Outputs the contained text until {% endverbatim %}
without evaluating any templating.
Evaluates the contained template using the given additional variables.