title: How can I use a variable in a jinja2 selectattr filter?
body: <p>I'm trying to filter a list based on an attribute. If I use the attribute as a string everything works fine:</p>
  
  <pre><code>{% set ys = xs | selectattr("type", "equalto", "first") | list %}
  </code></pre>
  
  <p>If I tried to use a variable (in my case a property of an enum) instead I get back an empty list</p>
  
  <pre><code>{% set ys = xs | selectattr("type", "equalto", MyEnum.FIRST) | list %}
  </code></pre>
  
  <p>The variable <code>MyEnum.FIRST</code> contains the string "first".</p>