title: SQLAlchemy: Execute/Add a function to a column in sqlalchemy
body: <p>I'm using SQLAlchemy and I have a query from which one of the columns I obtain is a constant QUOTE_STATUS_ERROR, the values in this column are integers. Since the constant value doesn't mean anything to the end-user, I'd like to convert that value from within the query itself to show a string by mapping the values of that column to a dictionary that I have in the app using a function I have in place for that purpose already. I haven't been able to find a way to implement it since Columns in the query are object not value of the column itself.  To make my question clear this is an example of what I have:</p>
  
  <p>Query:</p>
  
  <pre><code>q = meta.session.query(MyModel.id, MyModel.quote_status).join(AnotherModel).subquery("q")
  </code></pre>
  
  <p>Function I want to use:</p>
  
  <pre><code>def get_status_names(status_value):
      return QUOTE_STATUS_NAMES[status_value]
  </code></pre>
  
  <p>Is there a way to this directly from SQLAlchemy by attaching/passing a function (get_status_names()) to the column (MyModel.quote_status). If not what could be the best approach? I prefer not iterate over the values once I get the results in case the list of results is extensive. I would appreciate a push in the right direction.</p>
  
  <p><strong>UPDATE:</strong> I'm joining the resulting subquery with other tables</p>