]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Cascade mappers in terms of the instance's mapper
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 May 2017 14:53:54 +0000 (10:53 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 May 2017 14:55:55 +0000 (10:55 -0400)
commit06af579db292537d5f81394bba5855b0fdffb12c
tree700e32f6e36051243ef74be0d553c3b1a3533c44
parentaa14644d1ca06beda1dac338989c60e9de585a2a
Cascade mappers in terms of the instance's mapper

Fixed a (extremely old) bug in cascade_mappers where the
first cascade we do is against the "self" mapper, and not the
one that actually corresponds to the state given. These are
different in the case where we start with a relationship
to a class, and the instance is of a subclass, which itself
can have relationships that aren't on the base mapper.

A pretty severe bug that somehow has avoided the radar
since the beginning.

Change-Id: I512956b9757b07e06f3ca1ccb507a33fb10bed31
Fixes: #3986
(cherry picked from commit 0f8721fa52e335ab2abeb548c8914b99a8c5e1fd)
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/orm/mapper.py
test/orm/test_cascade.py