The runtime functions and state used by compiled templates.
Class |
|
Undocumented |
Class |
|
One block on a template reference. |
Class |
|
An undefined that is chainable, where both ``__getattr__`` and ``__getitem__`` return itself rather than raising an :exc:`UndefinedError`. |
Class |
|
The template context holds the variables of a template. It stores the values passed to the template and also the names the template exports. Creating instances is neither supported nor useful as it's created automatically at various stages of the template evaluation and should not be created by hand. |
Class |
|
An undefined that returns the debug info when printed. |
Class |
|
A wrapper iterable for dynamic ``for`` loops, with information about the loop and iteration. |
Class |
|
Undocumented |
Class |
|
Wraps a macro function. |
Class |
|
An undefined that barks on print and iteration as well as boolean tests and all kinds of comparisons. In other words: you can do nothing with it except checking if it's defined using the `defined` test. |
Class |
|
The `self` in templates. |
Class |
|
The default undefined type. This undefined type can be printed and iterated over, but every other access will raise an :exc:`UndefinedError`: |
Function | identity |
Returns its argument. Useful for certain things in the environment. |
Function | make |
Given a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created. |
Function | markup |
Concatenation that escapes if necessary and converts to string. |
Function | new |
Internal helper for context creation. |
Function | str |
Simple args to string conversion and concatenation. |
Constant | F |
Undocumented |
Constant | V |
Undocumented |
Variable | async |
Undocumented |
Variable | exported |
Undocumented |
Function | _dict |
Undocumented |
Given a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created. Example:: logger = logging.getLogger(__name__) LoggingUndefined = make_logging_undefined( logger=logger, base=Undefined ) .. versionadded:: 2.8 :param logger: the logger to use. If not provided, a default logger is created. :param base: the base class to add logging functionality to. This defaults to :class:`Undefined`.
Parameters | |
logger:t.Optional[ | Undocumented |
base:t.Type[ | Undocumented |
Returns | |
t.Type[ | Undocumented |
Concatenation that escapes if necessary and converts to string.
Parameters | |
seq:t.Iterable[ | Undocumented |
Returns | |
str | Undocumented |
Internal helper for context creation.
Parameters | |
environment:Environment | Undocumented |
templatet.Optional[ | Undocumented |
blocks:t.Dict[ | Undocumented |
vars:t.Optional[ | Undocumented |
shared:bool | Undocumented |
globals:t.Optional[ | Undocumented |
locals:t.Optional[ | Undocumented |
Returns | |
Context | Undocumented |
Simple args to string conversion and concatenation.
Parameters | |
seq:t.Iterable[ | Undocumented |
Returns | |
str | Undocumented |