[sqlalchemy] Re: joinedload().load_only() emits 2.0 warning

2021-07-21 Thread Lele Gaifax
Federico Caselli  writes:

> Updated here https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/2959

Great, thank you!

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
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/87k0li6gc2.fsf%40metapensiero.it.


Re: [sqlalchemy] async mode and relationship more than one level deep

2021-07-21 Thread Mike Bayer
you need to chain those like:

selectinload(Database.person).selectinload(Person.city)

docs:

https://docs.sqlalchemy.org/en/14/orm/loading_relationships.html#relationship-loading-with-loader-options



On Wed, Jul 21, 2021, at 4:25 PM, sector119 wrote:
> Hello, Mike
> 
> When I want to use some relationship I just set selectinload option on it like
> 
> s = select(Database).options(selectinload(Database.person))
> 
> Here Database.person is relationship with Person model
> 
> But what to do if I want to access some relationship of Person model? For 
> example Person.city,
> 
> I got errors when I set selectinload(Database.person.city) or 
> selectinload(Person.city)
> 
> Thank You
> 
> 
> -- 
> 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/4a389836-c41c-4db5-a427-75e87a39ff7bn%40googlegroups.com
>  
> .

-- 
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/ff82f50d-ccce-4452-8d8c-05ddc146e5a4%40www.fastmail.com.


[sqlalchemy] Re: async mode and relationship more than one level deep

2021-07-21 Thread sector119
s = select(
  Database
).options(
  selectinload(
Database.person
  ).options(
joinedload(Person.city)
  )
)

среда, 21 июля 2021 г. в 23:25:05 UTC+3, sector119: 

> Hello, Mike
>
> When I want to use some relationship I just set selectinload option on it 
> like
>
> s = select(Database).options(selectinload(Database.person))
>
> Here Database.person is relationship with Person model
>
> But what to do if I want to access some relationship of Person model? For 
> example Person.city,
>
> I got errors when I set selectinload(Database.person.city) or 
> selectinload(Person.city)
>
> Thank You
>

-- 
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/ee1aa492-29e0-4abe-afca-c34356fb7a24n%40googlegroups.com.


[sqlalchemy] async mode and relationship more than one level deep

2021-07-21 Thread sector119
Hello, Mike

When I want to use some relationship I just set selectinload option on it 
like

s = select(Database).options(selectinload(Database.person))

Here Database.person is relationship with Person model

But what to do if I want to access some relationship of Person model? For 
example Person.city,

I got errors when I set selectinload(Database.person.city) or 
selectinload(Person.city)

Thank You

-- 
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/4a389836-c41c-4db5-a427-75e87a39ff7bn%40googlegroups.com.