Skip to content
Myr

inheritance.py

This file

Path

examples/basic/inheritance.py

13 lines · 392 bytes · Python

Last changed by

Not known.

History of this file

Take it

1from jinja2 import Environment2from jinja2.loaders import DictLoader34env = Environment(5    loader=DictLoader(6        {7            "a": "[A[{% block body %}{% endblock %}]]",8            "b": "{% extends 'a' %}{% block body %}[B]{% endblock %}",9            "c": "{% extends 'b' %}{% block body %}###{{ super() }}###{% endblock %}",10        }11    )12)13print(env.get_template("c").render())