block.super in Tornado template system


In Tornado i have a base template with x block similar below:

{% block x %} x {% end %}

And in second template that inherited from base template i want to mix old value by new value similar django template tag, that is similar below code:

{% block x %} » {{ block.super }} « {% endblock %}

But in Tornado i cant use {{ block.super }}.

Tornado framework has equal django block.super?


Tornado does not currently have any equivalent to Django’s block.super. The simplest workaround is to move the part you want to reuse into a separate file so it can be included in both places with {% module Template('foo.html') %}

Answered By – Ben Darnell

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published