]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Annotate session-bind-lookup entity in Query-produced selectables
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 29 Aug 2019 16:09:17 +0000 (12:09 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 30 Aug 2019 21:57:38 +0000 (17:57 -0400)
commitf6c9b20a04d183d86078252048563b14e27fb6d2
treed8fbb764aa6322f56f2529fde793f937565bc96e
parent2b042b6d18dc527c12b2ef1239bfe5ee2b658930
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
doc/build/changelog/unreleased_14/4829.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/sql/annotation.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/selectable.py
test/orm/test_query.py
test/sql/test_selectable.py