title: How to interpret variables as dictionary indices
body: <p>I'm attempting to map integers to indices of a string dictionary.
  However, no substition occurs.
  If I hard code ( <code>um[2]</code> for example), the substitution is correct.</p>
  
  <p>What's a correct way of Getting It Done?</p>
  
  <p><strong>DB Schema:</strong></p>
  
  <pre><code>CREATE TABLE users (id integer primary key autoincrement, user text not null, um tinyint not null);
  </code></pre>
  
  <p><strong>Generator:</strong></p>
  
  <pre><code>users = [dict(id=row[0], name=row[1], um=row[2]) for row in cur.fetchall()]
  um = ["Limited", "Lessimited", "EvenLessLimited", "SuperUser"];
  return render_template('show_users.html', users=users, um=um)
  </code></pre>
  
  <p><strong>Template:</strong></p>
  
  <pre><code>{% for user in users %}
   {% set m = user.um|int %}
   &lt;tr&gt;&lt;td class="id"&gt;{{ user.id }}&lt;/td&gt;&lt;td&gt; {{ um[m] }}&lt;/td&gt;&lt;/tr&gt;
  {% endfor %}
  </code></pre>