query() will return a tuple of the items listed in the query. In your query
you are asking for a and b objects, so that is what you get. If you want the
result to be individual columns directly, you need to list them
individually.
db.query(a.a, a.acol1, b.b, b.bcol1).\
select_from(orm.join(a, b, a.a== b.a)).all()
if there are duplicate names in a and b you need to apply .label() to
distinguish the columns.
Unless your select_from() is especially complicated this can be simplified
and eliminate the subselect in the generated code
db.query(a.a, a.acol1, b.b, b.bcol1).join((b, a.a== b.a)).all()
or if you have foreign keys defined between a and b
db.query(a.a, a.acol1, b.b, b.bcol1).join(b).all()
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=.