-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 8, 2012, at 6:58 AM, Manlio Perillo wrote:

> 
> Maybe I'm missing something:
> http://paste.org/56806

use the reduce_columns() convenience method:

        query = foo.join(bar).select().reduce_columns()
        r = conn.execute(query).fetchall()

this is a replacement for the older version of this, "fold_equivalents":

        query = foo.join(bar).select(fold_equivalents=True)

reduce_columns() is a much improved version: 
http://docs.sqlalchemy.org/en/latest/core/expression_api.html#sqlalchemy.sql.expression.Select.reduce_columns

also, you need to not use UPPERCASE names when targeting result columns unless 
the real column name is not also uppercase - in 0.8 (which you'll need to get 
reduce_columns()), "case insensitivity" is now off by default:

        print r[0]
        print r[0].keys()
        print r[0]['id']


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJQm8jjAAoJEDMCOcHE2v7hC9kIAKcG8DeuOcCiMIZ53k+Ep/2i
b81Rqs+DrN01LkewGJR18vks7/+prgJxQ1EDqah26BOBp39BEJrexb90GCSU+Xni
vZdE1F1AOKjn/vBxz2uKuCOFhfaKRBi/mQlob4jE9M7CPb1rhHaTg3psKLtAjgPh
AWJU1vZOnBRkk6rPqkvh17nIg74iUPjY0EBBck1kwWsxxR1K3/XrFxGMQp13dHoz
sOJJF1NrxlXWJU7kzJ5dWUSHJTbrci3K4wPwEwWqJs/kcFq5E5tvkANsEe+KXS3j
RmDZD2qUnf8BcRjgL16x0zCLi5LU+YDpn6jvzeFivfo7js9Q7fDomIjD+STh61g=
=rV9z
-----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 sqlalchemy@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.

Reply via email to