I'm getting a problem while comparing two string in python:
this is working:
{% for publication in publications %}
{{ publications[publication].pub_type }}
{% endfor %}
but not this:
{% for publication in publications %}
{% if publications[publication].pub_type equals "conference_paper" %}
class="active"
{% endif %}
{% endfor %}
In the above code, I'm just testing something, but its not working
I'm getting this error:
jinja2.exceptions.TemplateSyntaxError
TemplateSyntaxError: expected token 'end of statement block', got 'equals'
perhaps you want:
{% if publication.pub_type == "conference_paper" %}
{# ^^ #}
equals
is not valid jinja2 syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With