diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/orm/events.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index 778ad3378..5bb67b68f 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -2397,6 +2397,13 @@ class QueryEvents(event.Events): The event should normally be listened with the ``retval=True`` parameter set, so that the modified query may be returned. + .. warning:: If the :meth:`.QueryEvents.before_compile` event is to + be applied to :class:`.Query` objects that are used for lazy loading + of :func:`.relationships` (as described at :ref:`lazy_loading`), + it may be necessary to set :paramref:`.relationship.bake_queries` + to ``False``, else the :meth:`.QueryEvents.before_compile` event + will not be invoked for each lazy load operation. + .. seealso:: :meth:`.QueryEvents.before_compile_update` |
