class documentation

class Template:

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method __iter__ Undocumented
Method __repr__ Undocumented
Method ​_render Undocumented
Method compile​_nodelist No summary
Method get​_exception​_info Return a dictionary containing contextual line information of where the exception occurred in the template. The following information is provided:
Method render Display stage -- can be called many times
Instance Variable engine Undocumented
Instance Variable name Undocumented
Instance Variable nodelist Undocumented
Instance Variable origin Undocumented
Instance Variable source Undocumented
def __init__(self, template_string, origin=None, name=None, engine=None):

Undocumented

def __iter__(self):

Undocumented

def __repr__(self):

Undocumented

def _render(self, context):

Undocumented

def compile_nodelist(self):
Parse and compile the template source into a nodelist. If debug is True and an exception occurs during parsing, the exception is annotated with contextual line information where it occurred in the template source.
def get_exception_info(self, exception, token):

Return a dictionary containing contextual line information of where the exception occurred in the template. The following information is provided:

message
The message of the exception raised.
source_lines
The lines before, after, and including the line the exception occurred on.
line
The line number the exception occurred on.
before, during, after
The line the exception occurred on split into three parts: 1. The content before the token that raised the error. 2. The token that raised the error. 3. The content after the token that raised the error.
total
The number of lines in source_lines.
top
The line number where source_lines starts.
bottom
The line number where source_lines ends.
start
The start position of the token in the template source.
end
The end position of the token in the template source.
def render(self, context):
Display stage -- can be called many times
engine =

Undocumented

name =

Undocumented

nodelist =

Undocumented

origin =

Undocumented

source =

Undocumented