> 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. 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/6ff6bf6c-0fa6-4795-a6f7-0b35d9417a08%40googlegroups.com.
