У меня неожиданный результат от этого кода
foo. html:
{{ include "bar.html" with x="x1.html" y="y1"}}
{{ include "bar.html" with x="x2.html" y="y2"}}
{{ include "bar.html" y="y3"}}
bar. html:
### THIS IS WORKING
{% if x %}
y
x
{{include x}}
{% else %}
pass
{% endif %}
### THIS IS NOT WORKING
<div class="modal" ......>
...
{% if x %}
y
x
{{include x}}
{% else %}
pass
{% endif %}
...
</div>
код работает хорошо, если я поставлю планку. html код за пределами modal
, но если код внутри modal
, это дает странный результат
y1
x1
<render x1.html>
y2
x1
<render x1.html> <--- why this render x1 and not x2
y3
x1
<render x1.html> <--- still printing x1 and rendering xx1html
django: 3.0.3 python: 3.6. 9