class documentation

class NativeTemplate(Template):

View In Hierarchy

Undocumented

Method render No summary
Async Method render​_async This works similar to render but returns a coroutine that when awaited returns the entire rendered template string. This requires the async feature to be enabled.

Inherited from Template:

Class Method from​_code Creates a template object from compiled code and the globals. This is used by the loaders and environment to create a template object.
Class Method from​_module​_dict Creates a template object from a module. This is used by the module loader to create a template object.
Class Method ​_from​_namespace Undocumented
Method __new__ Undocumented
Method __repr__ Undocumented
Method ​_get​_default​_module No summary
Async Method ​_get​_default​_module​_async Undocumented
Method generate No summary
Async Method generate​_async An async version of generate. Works very similarly but returns an async iterator instead.
Method get​_corresponding​_lineno Return the source line number of a line number in the generated bytecode as they are not in sync.
Method make​_module No summary
Async Method make​_module​_async No summary
Method new​_context No summary
Method stream Works exactly like generate but returns a TemplateStream.
Class Variable ​_debug​_info Undocumented
Class Variable ​_uptodate Undocumented
Class Variable blocks Undocumented
Class Variable environment Undocumented
Class Variable filename Undocumented
Class Variable globals Undocumented
Class Variable name Undocumented
Class Variable root​_render​_func Undocumented
Instance Variable ​_module Undocumented
Property debug​_info The debug info mapping.
Property is​_up​_to​_date If this variable is False there is a newer version available.
Property module The template as module. This is used for imports in the template runtime but is also useful if one wants to access exported template variables from the Python layer:
def render(self, *args, **kwargs):
Render the template to produce a native Python type. If the result is a single node, its value is returned. Otherwise, the nodes are concatenated as strings. If the result can be parsed with ast.literal_eval, the parsed value is returned. Otherwise, the string is returned.
Parameters
*args:t.AnyUndocumented
**kwargs:t.AnyUndocumented
Returns
t.AnyUndocumented
async def render_async(self, *args, **kwargs):

This works similar to render but returns a coroutine that when awaited returns the entire rendered template string. This requires the async feature to be enabled.

Example usage:

await template.render_async(knights='that say nih; asynchronously')
Parameters
*args:t.AnyUndocumented
**kwargs:t.AnyUndocumented
Returns
t.AnyUndocumented