From: Armin Ronacher Date: Wed, 24 Mar 2010 09:53:22 +0000 (+0100) Subject: Added improved documentation to the `ContextReference` node. X-Git-Tag: 2.4~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cedb482ad13998307959d650efe85fe7dff2845d;p=jinja2.git Added improved documentation to the `ContextReference` node. --HG-- branch : trunk --- diff --git a/jinja2/nodes.py b/jinja2/nodes.py index 6720fb1..15461e8 100644 --- a/jinja2/nodes.py +++ b/jinja2/nodes.py @@ -821,7 +821,16 @@ class MarkSafe(Expr): class ContextReference(Expr): - """Returns the current template context.""" + """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')) + """ class Continue(Stmt):