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 [email protected]. > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/3e1d6e90-7afd-4793-ac50-c3456505e24e%40app.fastmail.com.
