class documentation

class Template: (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method __iter__ Undocumented
Method __repr__ Undocumented
Method compile_nodelist 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.
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
Method _render Undocumented
def __init__(self, template_string, origin=None, name=None, engine=None): (source)

Undocumented

def __iter__(self): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def compile_nodelist(self): (source)

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): (source)

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): (source)

Display stage -- can be called many times

Undocumented

Undocumented

nodelist = (source)

Undocumented

Undocumented

Undocumented

def _render(self, context): (source)

Undocumented