]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Warnings for @declared_attr.cascading
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 26 Sep 2017 15:03:07 +0000 (11:03 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 26 Sep 2017 15:36:08 +0000 (11:36 -0400)
commitec1700ba29f7f15859ee6576855a4d6675265640
tree2b2f19bbcc5906139a1b88c527d46e64eceaf4bd
parent1b0b35f254f545dbeb3ad6e2215ba24ae1c02894
Warnings for @declared_attr.cascading

A warning is emitted if a subclass attempts to override an attribute
that was declared on a superclass using ``@declared_attr.cascading``
that the overridden attribute will be ignored. This use
case cannot be fully supported down to further subclasses without more
complex development efforts, so for consistency the "cascading" is
honored all the way down regardless of overriding attributes.

A warning is emitted if the ``@declared_attr.cascading`` attribute is
used with a special declarative name such as ``__tablename__``, as this
has no effect.

Ensure that documenation refers to the current inconsistency that
__tablename__ can be overridden by subclasses however
@declared_attr.cascading cannot.

Fixes: #4091
Fixes: #4092
Change-Id: I3aecdb2f99d408e404a1223f5ad86ae3c7fdf036
doc/build/changelog/unreleased_12/4091.rst [new file with mode: 0644]
doc/build/orm/extensions/declarative/mixins.rst
lib/sqlalchemy/ext/declarative/api.py
lib/sqlalchemy/ext/declarative/base.py
test/ext/declarative/test_mixin.py