Head-smack! Thanks and happy new year
Soumaya On Monday, 6 January 2020 02:20:01 UTC, Mike Bayer wrote: > > did you try: > > order_by(*t.primary_key) > > ? > > > > On Sun, Jan 5, 2020, at 7:02 PM, sumau wrote: > > Hello > > I 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'> instead > > > nRegards > > Soumaya > > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To 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 <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/c20800c0-e715-4d49-839e-6952f0dc690d%40googlegroups.com > > <https://groups.google.com/d/msgid/sqlalchemy/c20800c0-e715-4d49-839e-6952f0dc690d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/e1240c0a-514e-4ede-870d-01168af27637%40googlegroups.com.