]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Search through mapper superclass hierarchy for owner
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 9 Feb 2018 21:12:31 +0000 (16:12 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 9 Feb 2018 21:30:42 +0000 (16:30 -0500)
commit650b9eddae0eb198c8f8dc2d1e1e3c6ac53b18f3
treeecb640dd5d1e0f000a1dd97c96f4fdb2f5841570
parent9ef891e82c187b3fda0f778073f258ef8b55124f
Search through mapper superclass hierarchy for owner

Fixed regression caused by fix for issue :ticket:`4116` affecting versions
1.2.2 as well as 1.1.15, which had the effect of mis-calculation of the
"owning class" of an :class:`.AssociationProxy` as the ``NoneType`` class
in some declarative mixin/inheritance situations as well as if the
association proxy were accessed off of an un-mapped class.  The "figure out
the owner" logic has been replaced by an in-depth routine that searches
through the complete mapper hierarchy assigned to the class or subclass to
determine the correct (we hope) match; will not assign the owner if no
match is found.  An exception is now raised if the proxy is used
against an un-mapped instance.

Change-Id: I611b590df2babe077ce6c19bea89e84251d1a7f4
Fixes: #4185
doc/build/changelog/unreleased_11/4185.rst [new file with mode: 0644]
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/orm/instrumentation.py
test/ext/test_associationproxy.py