Skip to content
Myr

Added improved documentation to the `ContextReference` node.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 0dbaf39 · Browse files · 1 file+10 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−1 removed

  • other:+10 added−1 removed

1 file+10 added−1 removed

modified:jinja2/nodes.py+10 added-1 removed
819 unmodified lines
820 return Markup(self.expr.as_const(eval_ctx))821822823class ContextReference(Expr):824 """Returns the current template context."""824 """Returns the current template context. It can be used like a825 :class:`Name` node, with a ``'load'`` ctx and will return the826 current :class:`~jinja2.runtime.Context` object.827828 Here an example that assigns the current template name to a829 variable named `foo`::830831 Assign(Name('foo', ctx='store'),832 Getattr(ContextReference(), 'name'))833 """834835836class Continue(Stmt):837 """Continue a loop."""838839
32 unmodified lines