expressions
Render template expressions.
Functions¶
render_bool_expression
¶
render_bool_expression(
expression: Union[str, bool],
context: Optional[MutableMapping] = None,
) -> bool
Render a template expression and convert the result to a boolean.
Any string expression that is not a template string is wrapped in an {% if ... %}
block.
PARAMETER | DESCRIPTION |
---|---|
expression
|
A string expression, a template string, or a boolean. |
context
|
The context used to render a string
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the boolean is True, or the rendered result is not one of |
render_expression
¶
render_expression(
expression: str,
context: Optional[MutableMapping] = None,
) -> str
Render a template expression.