I'm trying to use the same functionality as in Django:
<div class="item {% if condition == True %}active{% endif %}">
In Odoo I have:
<t t-foreach="list" t-as="l">
<a t-attf-href="/downloads/{{l.id}}" class="list-group-item"><t t-esc="l.name"/></a>
</t>
And I need to append class "active" if "c.id = cat_id"
how it's done in Odoo?
I'm using:
<t t-foreach="categories" t-as="c">
<t t-if="c.id == category_id">
<a t-attf-href="/downloads/{{c.id}}" class="list-group-item active"><t t-esc="c.name"/></a>
</t>
<t t-if="c.id != category_id">
<a t-attf-href="/downloads/{{c.id}}" class="list-group-item"><t t-esc="c.name"/></a>
</t>
</t>
But searching for a more pythonic way