title: How to Use Mathematic Equations as Filters in SQLAlchemy
body: <p>I'm using the SQLAlchemy ORM to construct the MySQL queries in my application, and am perfectly able to add basic filters to the query, like so:</p>
  
  <pre><code>query = meta.Session.query(User).filter(User.user_id==1)
  </code></pre>
  
  <p>Which gives me something basically equivalent to this:</p>
  
  <pre><code>SELECT * FROM users WHERE user_id = 1
  </code></pre>
  
  <p>My question is how I would integrate some basic MySQL math functions into my query.  So, say for instance I wanted to get users near a certain latitude and longitude.  So I need to generate this SQL ($mylatitude and $mylongitude are the static latitude and longitude I'm comparing against):</p>
  
  <pre><code>SELECT * FROM users 
  WHERE SQRT(POW(69.1 * (latitude - $mylatitude),2) + POW(53.0 * (longitude - $mylongitude),2)) &lt; 5
  </code></pre>
  
  <p>Is there a way I can incorporate these functions into a query using the SQLAlchemy ORM?</p>