select([t]).order_by(t.primary_key.columns)
but I get the following error:sqlalchemy.exc.ArgumentError: SQL expression object expected, got object of type <class 'sqlalchemy.sql.base.ColumnCollection'> instead
nRegards
Soumaya--SQLAlchemy -The Python SQL Toolkit and Object Relational MapperTo post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.---You received this message because you are subscribed to the Google Groups "sqlalchemy" group.To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/c20800c0-e715-4d49-839e-6952f0dc690d%40googlegroups.com.
did you try:order_by(*t.primary_key)?On Sun, Jan 5, 2020, at 7:02 PM, sumau wrote:
HelloI was wondering if it was possible to sort a table by its 'unspecified' primary keys using the SQL Alchemy Expression Language?I have tried the following:t = Table ('test',metadata,autoload=True)select([t]).order_by(t.primary_key.columns)but I get the following error:sqlalchemy.exc.ArgumentError: SQL expression object expected, got object of type <class 'sqlalchemy.sql.base.ColumnCollection'> insteadnRegardsSoumaya
--SQLAlchemy -The Python SQL Toolkit and Object Relational MapperTo post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.---You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlal...@googlegroups.com.