class documentation

class RenderContext(BaseContext):

View In Hierarchy

A stack container for storing Template state.

RenderContext simplifies the implementation of template Nodes by providing a safe place to store state between invocations of a node's render method.

The RenderContext also provides scoping rules that are more sensible for 'template local' variables. The render context stack is pushed before each template is rendered, creating a fresh scope with nothing in it. Name resolution fails if a variable is not found at the top of the RequestContext stack. Thus, variables are local to a specific template and don't affect the rendering of other templates as they would if they were stored in the normal template context.

Method __contains__ Undocumented
Method __getitem__ Get a variable's value, starting at the current context and going upward
Method __iter__ Undocumented
Method get Undocumented
Method push​_state Undocumented
Instance Variable template Undocumented

Inherited from BaseContext:

Method __copy__ Undocumented
Method __delitem__ Delete a variable from the current context
Method __eq__ Compare two contexts by comparing theirs 'dicts' attributes.
Method __init__ Undocumented
Method __repr__ Undocumented
Method __setitem__ Set a variable in the current context
Method ​_reset​_dicts Undocumented
Method flatten Return self.dicts as one dictionary.
Method new Return a new context with the same properties, but with only the values given in 'values' stored.
Method pop Undocumented
Method push Undocumented
Method set​_upward Set a variable in one of the higher contexts if it exists there, otherwise in the current context.
Method setdefault Undocumented
Instance Variable dicts Undocumented
def __contains__(self, key):
def __getitem__(self, key):
Get a variable's value, starting at the current context and going upward
def __iter__(self):
def get(self, key, otherwise=None):
@contextmanager
def push_state(self, template, isolated_context=True):

Undocumented

template =

Undocumented