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: > > 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 cols down at the select statement > and just one from Y model like select(X.col1, X.col2, X.col3, Y.col1), X > model has plenty of cols, and I'm lazy ) > > Thanks > > > -- > 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+...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/e3681861-a4ac-4502-b1a4-2b36ca8648aan%40googlegroups.com > > <https://groups.google.com/d/msgid/sqlalchemy/e3681861-a4ac-4502-b1a4-2b36ca8648aan%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/a2524455-4782-471e-9427-8470ee9132fcn%40googlegroups.com.