There is any option to select JOIN result as dict?
For example I have:
1 | one
2 | two
3 | three
t2c1 | t2c2 | t2c3
11 | qwe | 1
22 | rty | 2
33 | zxcvb| 1
t2c3 from *table2 *is a foreign key to *table1*.
I want to show JOIN result
q = db.session.query(table1.t1c2, table2).join(table2).all()
as one dict:
But above query returns me result as tuple. I tried covert this result
using *asdict() *method, but it can't make from this one dictionary. I
can't create any query to resolve my problem.
I use latest SqlAlchemy with Postgres 9.5.
The Python SQL Toolkit and Object Relational Mapper
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
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.