]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- Removal of event listeners is now implemented. The feature is
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 26 Jul 2013 18:21:58 +0000 (14:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 26 Jul 2013 18:21:58 +0000 (14:21 -0400)
commit4505425a38b079a8e2a59fdbe31bc033de25e871
treed0dd695935aee0e26f8cd9ca36bc39f6df7e66ef
parent550141b14c8e165218cd32c27d91541eeee86d2a
- Removal of event listeners is now implemented.    The feature is
provided via the :func:`.event.remove` function.
[ticket:2268]
- reorganization of event.py module into a package; with the addition of the
docstring work as well as the new registry for removal, there's a lot more code now.
the package separates concerns and provides a top-level doc for each subsection
of functionality
- the remove feature works by providing the EventKey object which associates
the user-provided arguments to listen() with a global, weak-referencing registry.
This registry stores a collection of _ListenerCollection and _DispatchDescriptor
objects associated with each set of arguments, as well as the wrapped function
which was applied to that collection.  The EventKey can then be recreated for
a removal, all the _ListenerCollection and _DispatchDescriptor objects are located,
and the correct wrapped function is removed from each one.
16 files changed:
doc/build/changelog/changelog_09.rst
doc/build/changelog/migration_09.rst
doc/build/core/event.rst
lib/sqlalchemy/event.py [deleted file]
lib/sqlalchemy/event/__init__.py [new file with mode: 0644]
lib/sqlalchemy/event/api.py [new file with mode: 0644]
lib/sqlalchemy/event/attr.py [new file with mode: 0644]
lib/sqlalchemy/event/base.py [new file with mode: 0644]
lib/sqlalchemy/event/legacy.py [new file with mode: 0644]
lib/sqlalchemy/event/registry.py [new file with mode: 0644]
lib/sqlalchemy/events.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/instrumentation.py
test/aaa_profiling/test_memusage.py
test/base/test_events.py
test/orm/test_events.py