Je suis prêt à inclure un bloc de code partagé dans les modèles qui étendent un modèle différent.
Voici une page rendue et 2 variantes du modèle de base.Le rendu de bloc est ignoré dans le bloc de modèle inclus
page.html:
{% extends "base_form.html"%}
{% block legend %}legend{% endblock %}
Variante 1:
base_form.html:
{% extends "base.html"%}
{% block body %}
{% block legend %}{% endblock %}
{% endblock %}
rendu:
legend
Variante 2:
base_form.html:
{% extends "base.html"%}
{% block body %}
{% include "chunks/form.html" %}
{% endblock %}
morceaux/form.html:
coming from a chunk
{% block legend %}{% endblock %}
rendu:
coming from a chunk
Ainsi, le bloc est sauté dans le second cas. Assez curieusement, tout fonctionne avec django-debug-toolbar activé.
Un bug?