views:

22

answers:

1

Currently, i am querying with this code: meta.Session.query(Label).order_by(Label.name).all() and it returns me objects sorted by Label.name in this manner ['1','7','1a','5c']. Is there a way i can have the objects returned in the order with their Label.name sorted like this ['1','1a','5c','7']

Thanks!

+1  A: 

Sorting is done by the database. If you database doesn't support natural sorting your are out of luck and have to sort your rows manually after retrieving them via sqlalchemy.

ThiefMaster