]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
add RegistryEvents
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 31 Aug 2025 22:53:01 +0000 (18:53 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Sep 2025 15:27:29 +0000 (11:27 -0400)
commit7111dc0cbaae2070173e9f4a054745ee7d036dfa
tree03c9e2ec91f085299f1ed772722956abd7c562b0
parent8f7138326cf48a1394417aa492ad083b3400c529
add RegistryEvents

Added :class:`_orm.RegistryEvents` event class that allows event listeners
to be established on a :class:`_orm.registry` object. The new class
provides three events: :meth:`_orm.RegistryEvents.resolve_type_annotation`
which allows customization of type annotation resolution that can
supplement or replace the use of the
:paramref:`.registry.type_annotation_map` dictionary, including that it can
be helpful with custom resolution for complex types such as those of
:pep:`695`, as well as :meth:`_orm.RegistryEvents.before_configured` and
:meth:`_orm.RegistryEvents.after_configured`, which are registry-local
forms of the mapper-wide version of these hooks.

Fixes: #9832
Change-Id: I32b55de8625ec435edf916a91e65f61fda50cd51
14 files changed:
doc/build/changelog/migration_21.rst
doc/build/changelog/unreleased_21/9832.rst [new file with mode: 0644]
doc/build/orm/declarative_tables.rst
doc/build/orm/events.rst
lib/sqlalchemy/orm/__init__.py
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/util/typing.py
test/orm/test_events.py