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