projects
/
jinja2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dbaf39
)
Added improved documentation to the `ContextReference` node.
author
Armin Ronacher
<armin.ronacher@active-4.com>
Wed, 24 Mar 2010 09:53:22 +0000
(10:53 +0100)
committer
Armin Ronacher
<armin.ronacher@active-4.com>
Wed, 24 Mar 2010 09:53:22 +0000
(10:53 +0100)
--HG--
branch : trunk
jinja2/nodes.py
patch
|
blob
|
history
diff --git
a/jinja2/nodes.py
b/jinja2/nodes.py
index 6720fb1d956b8ef36d962cf85b9da0d0a469c33b..15461e8a73f854570909816da4b356a2545542e4 100644
(file)
--- 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):