diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2022-01-06 19:15:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-01-06 19:15:06 +0000 |
| commit | dd5f9c2039731adb6c019c4cc3a39694f9b236ad (patch) | |
| tree | ce80dd61476c0c09f792f5690c7c7434b7876cc7 /lib/sqlalchemy/ext | |
| parent | f3c93170dcbe705da25bc18bad2b29620d82a490 (diff) | |
| parent | 01c50c64e302c193733cef7fb146fbab8eaa44bd (diff) | |
| download | sqlalchemy-dd5f9c2039731adb6c019c4cc3a39694f9b236ad.tar.gz | |
Merge "Remove all remaining removed_in_20 warnings slated for removal" into main
Diffstat (limited to 'lib/sqlalchemy/ext')
| -rw-r--r-- | lib/sqlalchemy/ext/declarative/__init__.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/declarative/extensions.py | 19 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/mutable.py | 5 |
3 files changed, 2 insertions, 23 deletions
diff --git a/lib/sqlalchemy/ext/declarative/__init__.py b/lib/sqlalchemy/ext/declarative/__init__.py index b1c1d3691..ebb992742 100644 --- a/lib/sqlalchemy/ext/declarative/__init__.py +++ b/lib/sqlalchemy/ext/declarative/__init__.py @@ -8,7 +8,6 @@ from .extensions import AbstractConcreteBase from .extensions import ConcreteBase from .extensions import DeferredReflection -from .extensions import instrument_declarative from ... import util from ...orm.decl_api import as_declarative as _as_declarative from ...orm.decl_api import declarative_base as _declarative_base diff --git a/lib/sqlalchemy/ext/declarative/extensions.py b/lib/sqlalchemy/ext/declarative/extensions.py index 1862592f5..b7c0e78d9 100644 --- a/lib/sqlalchemy/ext/declarative/extensions.py +++ b/lib/sqlalchemy/ext/declarative/extensions.py @@ -8,9 +8,7 @@ from ... import inspection -from ... import util from ...orm import exc as orm_exc -from ...orm import registry from ...orm import relationships from ...orm.base import _mapper_or_none from ...orm.clsregistry import _resolver @@ -20,23 +18,6 @@ from ...schema import Table from ...util import OrderedDict -@util.deprecated( - "2.0", - "the instrument_declarative function is deprecated " - "and will be removed in SQLAlhcemy 2.0. Please use " - ":meth:`_orm.registry.map_declaratively", -) -def instrument_declarative(cls, cls_registry, metadata): - """Given a class, configure the class declaratively, - using the given registry, which can be any dictionary, and - MetaData object. - - """ - registry(metadata=metadata, class_registry=cls_registry).map_declaratively( - cls - ) - - class ConcreteBase: """A helper class for 'concrete' declarative mappings. diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 7e277d379..7a497abfc 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -360,7 +360,6 @@ from .. import event from .. import inspect from .. import types from ..orm import Mapper -from ..orm import mapper from ..orm.attributes import flag_modified from ..sql.base import SchemaEventTarget from ..util import memoized_property @@ -567,7 +566,7 @@ class Mutable(MutableBase): if isinstance(prop.columns[0].type, sqltype): cls.associate_with_attribute(getattr(class_, prop.key)) - event.listen(mapper, "mapper_configured", listen_for_type) + event.listen(Mapper, "mapper_configured", listen_for_type) @classmethod def as_mutable(cls, sqltype): @@ -629,7 +628,7 @@ class Mutable(MutableBase): ) or (prop.columns[0].type is sqltype): cls.associate_with_attribute(getattr(class_, prop.key)) - event.listen(mapper, "mapper_configured", listen_for_type) + event.listen(Mapper, "mapper_configured", listen_for_type) return sqltype |
