title: sqlalchemy bind values
body: <p>I want to get the value of a parameter in a sqlalchemy query object dynamically:</p>
  
  <pre><code>q = session.query(Model).filter(Model.foo = 6)
  </code></pre>
  
  <p>I now want to be able to retrieve the value <code>6</code> from <code>q</code></p>
  
  <pre><code>assert(q.magic == 6)
  </code></pre>
  
  <p>Attempts:</p>
  
  <pre><code>print(q._criterion) # -&gt; models.foo = :foo_1
  </code></pre>
  
  <p>But where is the value of <code>foo_1</code>?</p>