Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
jinja2.nodes.ContextReference Class Reference
Inheritance diagram for jinja2.nodes.ContextReference:
Inheritance graph
[legend]
Collaboration diagram for jinja2.nodes.ContextReference:
Collaboration graph
[legend]

Additional Inherited Members

- Public Member Functions inherited from jinja2.nodes.Expr
t.Any as_const (self, t.Optional[EvalContext] eval_ctx=None)
 
bool can_assign (self)
 
- Public Member Functions inherited from jinja2.nodes.Node
None __init__ (self, *t.Any fields, **t.Any attributes)
 
t.Iterator[t.Tuple[str, t.Any]] iter_fields (self, t.Optional[t.Container[str]] exclude=None, t.Optional[t.Container[str]] only=None)
 
t.Iterator["Node"] iter_child_nodes (self, t.Optional[t.Container[str]] exclude=None, t.Optional[t.Container[str]] only=None)
 
t.Optional[_NodeBound] find (self, t.Type[_NodeBound] node_type)
 
t.Iterator[_NodeBound] find_all (self, t.Union[t.Type[_NodeBound], t.Tuple[t.Type[_NodeBound],...]] node_type)
 
"Node" set_ctx (self, str ctx)
 
"Node" set_lineno (self, int lineno, bool override=False)
 
"Node" set_environment (self, "Environment" environment)
 
bool __eq__ (self, t.Any other)
 
str __repr__ (self)
 
str dump (self)
 
- Public Member Functions inherited from jinja2.nodes.NodeType
 __new__ (mcs, name, bases, d)
 
- Public Attributes inherited from jinja2.nodes.Node
 fields
 
- Static Public Attributes inherited from jinja2.nodes.Expr
bool abstract = True
 
- Static Public Attributes inherited from jinja2.nodes.Node
tuple fields = ()
 
tuple attributes = ("lineno", "environment")
 
bool abstract = True
 
int lineno
 
environment .Optional["Environment"]
 

Detailed Description

Returns the current template context.  It can be used like a
:class:`Name` node, with a ``'load'`` ctx and will return the
current :class:`~jinja2.runtime.Context` object.

Here an example that assigns the current template name to a
variable named `foo`::

    Assign(Name('foo', ctx='store'),
           Getattr(ContextReference(), 'name'))

This is basically equivalent to using the
:func:`~jinja2.pass_context` decorator when using the high-level
API, which causes a reference to the context to be passed as the
first argument to a function.

The documentation for this class was generated from the following file: