On Tue, Oct 22, 2019, at 11:58 AM, Eric Lemoine wrote:
> 
> 
>>> The first time before_compile is called twice, one call for the SELECT FROM 
>>> "user" query, and another call for the SELECT FROM "address" query. But the 
>>> second time before_compile is called only once. It's called for the SELECT 
>>> FROM "user" query, but not for the SELECT FROM "addresses" query. Is it 
>>> expected?
>>> 
>>> I am using SQLAlchemy 1.3.10.
>> 
>> sure, it sounds like u.addresses is already loaded. if you want u.addresses 
>> to emit a query every time it is called you need to use the "dynamic" loader 
>> strategy, that is, lazy="dynamic".
> 
> 
> I think the problem is related to "baked queries". I don't have the problem 
> with enable_baked_queries set to False in sessionmaker.

oh right that too, those queries are cached. but whatever changes you made to 
the query should also be cached, how come you need it to be different every 
time?



> 
> Thanks for your response.
> 

> --
>  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/6ff6bf6c-0fa6-4795-a6f7-0b35d9417a08%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/6ff6bf6c-0fa6-4795-a6f7-0b35d9417a08%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/c91d7e94-9eb7-46c5-abc1-02c1a163e1dd%40www.fastmail.com.

Reply via email to