]> 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 15:42:31 +0000 (11:42 -0400)
commit4c931b2ec7e0f09ac8c3ebe28c794f5858d54efb
tree9c7e96955068a63d10f760748e69ed3ac7e3b742
parent9a5be7bb92de692c13215ea9b336c831400d5a5e
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
doc/build/changelog/unreleased_12/4321.rst [new file with mode: 0644]
lib/sqlalchemy/ext/declarative/base.py
test/ext/declarative/test_inheritance.py