diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-08-29 12:09:17 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-08-30 17:57:38 -0400 |
| commit | f6c9b20a04d183d86078252048563b14e27fb6d2 (patch) | |
| tree | d8fbb764aa6322f56f2529fde793f937565bc96e /lib/sqlalchemy/sql/selectable.py | |
| parent | 2b042b6d18dc527c12b2ef1239bfe5ee2b658930 (diff) | |
| download | sqlalchemy-f6c9b20a04d183d86078252048563b14e27fb6d2.tar.gz | |
Annotate session-bind-lookup entity in Query-produced selectables
Added new entity-targeting capabilities to the :class:`.Query` object to
help with the case where the :class:`.Session` is using a bind dictionary
against mapped classes, rather than a single bind, and the :class:`.Query`
is against a Core statement that was ultimately generated from a method
such as :meth:`.Query.subquery`; a deep search is performed to locate
any ORM entity related to the query in order to locate a mapper if
one is not otherwise present.
Fixes: #4829
Change-Id: I95cf325a5aba21baec4b313246c6f4d692284820
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
| -rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 03dbcd449..97c49f8fc 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -19,6 +19,7 @@ from . import operators from . import roles from . import type_api from .annotation import Annotated +from .annotation import SupportsCloneAnnotations from .base import _clone from .base import _cloned_difference from .base import _cloned_intersection @@ -2068,6 +2069,7 @@ class SelectBase( roles.InElementRole, HasCTE, Executable, + SupportsCloneAnnotations, Selectable, ): """Base class for SELECT statements. |
