L
L
lunrox2014-02-14 15:26:56
Django
lunrox, 2014-02-14 15:26:56

Custom tag inside a condition in a Django template?

Hello

{% load od %}
{% with cod=companyoperationdiagram %}
    {% with monday=cod.day1 %}
        {% if cod.day1 != 'day off' %}
            <p>Время работы:</p>
            <p>c {% get_start cod.day1 %}</p><br>
            <p>до {% get_end cod.day1 %}</p><br>
            <p>обед:</p><br>
            <p>до {% get_dinner_start cod.day1 %}</p><br>
            <p>до {% get_dinner_end cod.day1 %}</p><br>
        {% else %}
            <p>Выходной</p>
        {% endif %}
    {% endwith %}
{% endwith %}

I get an error:
Exception Value:
Invalid block tag: 'get_start', expected 'elif','else' or 'endif'
How can I get around this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
leclecovich, 2014-02-14
@lunrox

Apparently the get_start tag was not loaded. Check if it is in the od template, and also if there are any collisions when loading the template.

Z
zxmd, 2014-02-14
@zxmd

Weird. Everything should be fine. Maybe a problem with the tag itself?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question