]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Intercept contains_eager() with of_type, set aliased / polymorphic
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 3 Nov 2017 15:11:48 +0000 (11:11 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Dec 2017 22:35:40 +0000 (17:35 -0500)
commit8ab652c6cb48ca6e157233aa3a23049e318d9d2b
tree668c42f0af5039080120bf31951ca1f4c29b8dc8
parentbcbff960a17654004a08401546d8c2d990ee9894
Intercept contains_eager() with of_type, set aliased / polymorphic

Fixed bug in :func:`.contains_eager` query option where making use of a
path that used :meth:`.PropComparator.of_type` to refer to a subclass
across more than one level of joins would also require that the "alias"
argument were provided with the same subtype in order to avoid adding
unwanted FROM clauses to the query; additionally,  using
:func:`.contains_eager` across subclasses that use :func:`.aliased` objects
of subclasses as the :meth:`.PropComparator.of_type` argument will also
render correctly.

Change-Id: Ie1c10924faa45251aab1a076a3ba7ef9fb1bdeee
Fixes: #4130
doc/build/changelog/unreleased_12/4130.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategy_options.py
test/orm/test_of_type.py