get content from parent block in jinja2
问题 I need to get content from particular block in Jinja2 by console script. For example //global template {% block target %} <some_content_from_top> {% endblock %} //parent template {% extends 'top.html' %} {% block target %} <some_content_from_parent> {% endblock %} //child template {% extends 'parent.html' %} {% block target %} <some_content> {% endblock %} I can use something like that to get content from this block in particular template without inheritanse template_source = self.env.loader