Reputation: 4865
Is there a way to order the rows returned by a SQLAlchemy query alphabetically in the actual query, or is the only way to order alphabetically is to sort the list of rows that the query returns.
Upvotes: 10
Views: 6935
Reputation: 154494
You can add an order_by
clause:
query = query.order_by(MyTable.column_name)
Upvotes: 14