summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2008-04-13 23:18:05 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2008-04-13 23:18:05 +0200
commit62f8a2984c8b2ffc712ae7bbed6cf4e59eaa2dbe (patch)
tree00d464f9e97c43cceedd85ac3602623a8cfa5a74 /examples
parentfed44b5f36e9da972dd4f792eacedafe80dd5e7f (diff)
downloadjinja2-62f8a2984c8b2ffc712ae7bbed6cf4e59eaa2dbe.tar.gz
added super()
--HG-- branch : trunk
Diffstat (limited to 'examples')
-rw-r--r--examples/inheritance.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/inheritance.py b/examples/inheritance.py
new file mode 100644
index 0000000..aa687c8
--- /dev/null
+++ b/examples/inheritance.py
@@ -0,0 +1,12 @@
+from jinja2 import Environment
+from jinja2.loaders import DictLoader
+
+
+env = Environment(loader=DictLoader({
+'a': '''[A[{% block body %}{% endblock %}]]''',
+'b': '''{% extends 'a' %}{% block body %}[B]{% endblock %}''',
+'c': '''{% extends 'b' %}{% block body %}###{{ super() }}###{% endblock %}'''
+}))
+
+
+print env.get_template('c').render()