I've recently been tasked with a small project that involves jinja/html and 
have never touched either before though I do know Java and some Python. I'm 
playing with jinja and am having trouble with variable (the if else 
statements work fine). Here's a snippet of what I'm trying to do:

        {% set list_one = [] %}
        {% set list_two = [] %}
        {% for collection in data.hierarchy %}
            {% if collection.collection_id|string == 
data.collection_id|string %}
                {% do list_one.append('collection.name') %}
                {% do list_one.append('collection.path') %}
            {% else %}
                {% do list_two.append('collection.name') %}
                {% do list_two.append('collection.path') %}
            {% endif %}

It hits the 'do' statements fine, but when it does it throws an error:

TemplateSyntaxError: Encountered unknown tag 'do'. Jinja was looking for 
the following tags: 'endif'. The innermost block that needs to be closed is 
'if'.

Does anyone know what I'm doing wrong?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pocoo-libs.
For more options, visit https://groups.google.com/d/optout.

Reply via email to