-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Bayer ha scritto: > Manlio Perillo wrote: > [...] > query = sql.join(x, y).select() > r = engine.execute(query).fetchone() > [...] > > This code will raise an: > sqlalchemy.exc.InvalidRequestError: Ambiguous column name 'id' in result > set! try 'use_labels' option on select statement. > >> send fold_equivalents=True to join().select(). This flag has been >> deprecated for awhile but I suppose it is harmless if you truly have a use >> case for it (i.e. i will consider un-deprecating it, i didnt think anyone >> would ever need it). >
Well, the use case it to avoid the use of: 1) use_labels 2) ad hoc column names, to avoid ambiguous columns 3) explicit labels Unfortunately, fold_equivalents is not a generic solution for me I have a generative query, where I later add the select_from object. The query is generative, since the tables involved are not know in advance. I have several plugins, that take a query instance as input, and return the (modified) query, and the additional tables involved. These tables are later joined together. > [...] Thanks Manlio -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkt65DsACgkQscQJ24LbaUR98wCfctnfwAHUHsnJ1j9pskhp6u5z MtwAnixPKZqMg9VzCtdTOlLAO0dN4AGu =8qMv -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.