This bit:
query(table1.t1c2, table2)
Is instructing SqlAlchemy to return a tuple that contains those two discrete "objects" - the first being a column of `table1`, the second being a instance of `table2` (or a row). The ORM is then mapping table2 onto an object.
To *somewhat* achieve your goal and avoid the object creation, you can explicitly enumerate your query:
r = db.session.query(Table1.t1c2, Table2.t2c1, Table2.t2c2, Table2.t2c3).join(Table2).all()
That will return an iterator of 3 element tuples in that order:
[(u'one', 11, u'qwe', 1),
(u'two', 22, u'rty', 2),
(u'one', 33, u'zxcvb', 1)
]
You can cast each one into a dict individually:
for row in r:
print row._as_dict()
will generate:
{'t1c2': u'one', 't2c3': 1, 't2c2': u'qwe', 't2c1': 11}
{'t1c2': u'two', 't2c3': 2, 't2c2': u'rty', 't2c1': 22}
{'t1c2': u'one', 't2c3': 1, 't2c2': u'zxcvb', 't2c1': 33}
That brings me to this point -- can you share a self-contained example of your code?
I can't figure out how you're getting `q.all()._asdict()` to work. It shouldn't work, because the result should be an iterable/list that does not have that method.