Задать вопрос

Тел: +7 965 3737 888

405

Просмотров

0

Ответов

PyIfTag - Just like python if expression

<p>How to use it </p>
{% pyif i == 1 %}
    &lt;p&gt;i=1&lt;/p&gt;
{% elif i == 3 %}
    &lt;p&gt;i=3&lt;/p&gt;
{% else %}
    &lt;p&gt;other&lt;/p&gt;
{% endif %}

<p>Warning: For now, django don't support elif, so you can use it. And I'v submit a patch about to fix it ( #3090 ). If the patch is accepted, you can use elif tag. </p>

Вопрос полезен? Да0/Нет0
file_3289.py(1.3Кб)
None