q.all() returns me a result in format: 
[('one', {'t2c2': 'qwe',
  't2c1': '11',
  't2c3': '1'}),
('two', {'t2c2': 'rty',
  't2c1': '22',
  't2c3': '2'}),
..]

The result of
q.all()._asdict()
is
[{
  't1c2': 'one',
  'table2': {
    't2c2': 'qwe',
    't2c1': '11',
    't2c3': '1'
  }
},
{
  't1c2': 'two',
  'table2': {
    't2c2': 'rty',
    't2c1': '22',
    't2c3': '2'
  }
},
...]

Above solutions aren't result whose I excepted.
I try to avoid any casting in Python.

Is it possible?


W dniu poniedziałek, 17 października 2016 18:52:59 UTC+2 użytkownik 
Jonathan Vanasco napisał:
>
> Your query's underlying sql returns multiple rows.  You can cast those 
> results into a dict in Python.
>
>
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

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 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to