]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Early-assign Base.registry to a private name
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Mar 2021 19:03:22 +0000 (15:03 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Mar 2021 19:14:00 +0000 (15:14 -0400)
commitd386552d11ea697463211c1499b2bee2f5548be7
treef07f03c7bd96bb2573605acc720b0425e5dc0a6c
parentc949312bc1a1980da016918d9c4b002b68062fca
Early-assign Base.registry to a private name

Fixed bug where user-mapped classes that contained an attribute named
"registry" would cause conflicts with the new registry-based mapping system
when using :class:`.DeclarativeMeta`. While the attribute remains
something that can be set explicitly on a declarative base to be
consumed by the metaclass, once located it is placed under a private
class variable so it does not conflict with future subclasses that use
the same name for other purposes.

Fixes: #6054
Change-Id: I1f2e04b0d74c493e7e90eadead4e861d8960a794
doc/build/changelog/unreleased_14/6054.rst [new file with mode: 0644]
lib/sqlalchemy/orm/decl_api.py
test/orm/declarative/test_basic.py