From: Takashi Kajinami Date: Mon, 29 Jul 2024 16:01:04 +0000 (-0400) Subject: Import all legacy classes by sqlalchemy.orm.collections.* X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6e9ca40bddbd6e670d40bc4ae952e1ee67d8816;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Import all legacy classes by sqlalchemy.orm.collections.* Restored legacy class names removed from ``sqlalalchemy.orm.collections.*``, including :class:`_orm.MappedCollection`, :func:`_orm.mapped_collection`, :func:`_orm.column_mapped_collection`, :func:`_orm.attribute_mapped_collection`. Pull request courtesy Takashi Kajinami. Fixes: #11435 Closes: #11432 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11432 Pull-request-sha: 66f20a8e2069f48665299d1ee220dfe57aedf79e Change-Id: I05172669fc9a44e737b3714001d1317bbbf0012f --- diff --git a/doc/build/changelog/unreleased_20/11435.rst b/doc/build/changelog/unreleased_20/11435.rst new file mode 100644 index 0000000000..8e9ac23396 --- /dev/null +++ b/doc/build/changelog/unreleased_20/11435.rst @@ -0,0 +1,13 @@ +.. change:: + :tags: bug, general, regression + :tickets: 11435 + + Restored legacy class names removed from + ``sqlalalchemy.orm.collections.*``, including + :class:`_orm.MappedCollection`, :func:`_orm.mapped_collection`, + :func:`_orm.column_mapped_collection`, + :func:`_orm.attribute_mapped_collection`. Pull request courtesy Takashi + Kajinami. + + + . diff --git a/lib/sqlalchemy/orm/collections.py b/lib/sqlalchemy/orm/collections.py index 394a4eaba5..956cbd651a 100644 --- a/lib/sqlalchemy/orm/collections.py +++ b/lib/sqlalchemy/orm/collections.py @@ -148,10 +148,12 @@ __all__ = [ "keyfunc_mapping", "column_keyed_dict", "attribute_keyed_dict", - "column_keyed_dict", - "attribute_keyed_dict", - "MappedCollection", "KeyFuncDict", + # old names in < 2.0 + "mapped_collection", + "column_mapped_collection", + "attribute_mapped_collection", + "MappedCollection", ] __instrumentation_mutex = threading.Lock()