Re: [sqlalchemy] "flatten" model columns in Row

2022-11-20 Thread sector119
Thank you, Mike! воскресенье, 20 ноября 2022 г. в 16:31:09 UTC+2, Mike Bayer: > the quickest way at the moment is to use select(X.__table__, y_col), or, > if you use select(X), you can execute from session.connection().execute(). > > > > On Sat, Nov 19, 2022, at 5:31 PM, sector119 wrote: >

Re: [sqlalchemy] "flatten" model columns in Row

2022-11-20 Thread Mike Bayer
the quickest way at the moment is to use select(X.__table__, y_col), or, if you use select(X), you can execute from session.connection().execute(). On Sat, Nov 19, 2022, at 5:31 PM, sector119 wrote: > Hello > > For example I have two models X and Y, I want to get all columns from X model >

[sqlalchemy] "flatten" model columns in Row

2022-11-19 Thread sector119
Hello For example I have two models X and Y, I want to get all columns from X model and only one or two cols from Y model in the same Row as [(x_col1, x_col2, x_col3, y_col1), ...] but not [(X, y_col1)] as I get when I perform select(X, Y.col1).join(X.y) I just don't want to write all X model