records = [str(record[0]) for record in session.query(Widget.serial_number).order_by(desc(Widget.name))] print(' '.join(records)) code example
Example: sqlalchemy order_by
from sqlalchemy import desc
someselect.order_by(desc(table1.mycol))
from sqlalchemy import desc
someselect.order_by(desc(table1.mycol))