]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Accommodate for classically mapped base classes in declarative
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 17 Aug 2018 15:37:30 +0000 (11:37 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 17 Aug 2018 17:42:02 +0000 (13:42 -0400)
commitdaab9ad4cc8861a466a0856d3aec85cb08ab6a17
treee99cc9c806d4c5a3df2c7178723f62c34d3fe77f
parent7b53d9962f438cebaf82e95b3c8304578545c132
Accommodate for classically mapped base classes in declarative

Fixed issue in previously untested use case, allowing a declarative mapped
class to inherit from a classically-mapped class outside of the declarative
base, including that it accommodates for unmapped intermediate classes. An
unmapped intermediate class may specify ``__abstract__``, which is now
interpreted correctly, or the intermediate class can remain unmarked, and
the classically mapped base class will be detected within the hierarchy
regardless. In order to anticipate existing scenarios which may be mixing
in classical mappings into existing declarative hierarchies, an error is
now raised if multiple mapped bases are detected for a given class.

Fixes: #4321
Change-Id: I8604ecfd170d2589d9d1b1c87ba303762071fc30
(cherry picked from commit 4c931b2ec7e0f09ac8c3ebe28c794f5858d54efb)
doc/build/changelog/unreleased_12/4321.rst [new file with mode: 0644]
lib/sqlalchemy/ext/declarative/base.py
test/ext/declarative/test_inheritance.py