diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-06-08 11:54:46 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-06-08 11:54:46 -0400 |
| commit | 258d07e478eab9ee385f36a5c5fd56c56bf7dfea (patch) | |
| tree | c98e274073322d86eeb03a40f3a36996e74f8592 | |
| parent | 1961e1321440a1e0500ecd13624837ed088eaceb (diff) | |
| download | sqlalchemy-258d07e478eab9ee385f36a5c5fd56c56bf7dfea.tar.gz | |
add note re: pickling for loader criteria
Change-Id: I75992af71ba08799a03995178a6e4612c9a7428a
References: #8108
| -rw-r--r-- | lib/sqlalchemy/orm/_orm_constructors.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/_orm_constructors.py b/lib/sqlalchemy/orm/_orm_constructors.py index e68282865..6ef0a647f 100644 --- a/lib/sqlalchemy/orm/_orm_constructors.py +++ b/lib/sqlalchemy/orm/_orm_constructors.py @@ -724,11 +724,19 @@ def with_loader_criteria( accepts a target class as an argument, when the given class is a base with many different mapped subclasses. + .. note:: when the SQL expression is a lambda, **pickling is not + supported**. Set + :paramref:`_orm.with_loader_criteria.propagate_to_loaders` + to ``False`` to prevent the object from being applied to instances. + :param include_aliases: if True, apply the rule to :func:`_orm.aliased` constructs as well. :param propagate_to_loaders: defaults to True, apply to relationship - loaders such as lazy loaders. + loaders such as lazy loaders. This indicates that the + option object itself including SQL expression is carried along with + each loaded instance. Set to ``False`` to prevent the object from + being assigned to individual instances. .. seealso:: |
