title: How to provide the sort order in a variable in sqlalchemy?
body: <p>Right now what I am doing is as :</p>
  
  <pre><code>if order_type == 'desc':
      result = session.\
               query(Customer).\
               order_by(desc(getattr(Customer, sorting_column_name))).\
               all()
  else:
      result = session.\
               query(Customer).\
               order_by(asc(getattr(Customer, sorting_column_name))).\
               all()
  </code></pre>
  
  <p>Is there any way to call <code>order_by</code> just once and use sorting order provided in <code>order_type</code> as a variable to decide whether to sort <code>asc</code> or <code>desc</code>?</p>