diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-17 19:59:45 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-17 19:59:45 -0500 |
| commit | 7dab4ae6a9ca057bb99be2f01efc26610be12f63 (patch) | |
| tree | 69e2a7a7bca8899c6fa44616c919cf3b232cb3a0 /lib/sqlalchemy/event.py | |
| parent | e7c5fd7b22dd21ec1c1cac177b9ee611779903e3 (diff) | |
| download | sqlalchemy-7dab4ae6a9ca057bb99be2f01efc26610be12f63.tar.gz | |
- rename EngineEvents to ConnectionEvents
- simplify connection event model to be inline inside Connection, don't use ad-hoc
subclasses (technically would leak memory for the app that keeps creating engines
and adding events)
- not doing listen-per-connection yet. this is closer. overall things
are much simpler now (until we put listen-per-connection in...)
Diffstat (limited to 'lib/sqlalchemy/event.py')
| -rw-r--r-- | lib/sqlalchemy/event.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/sqlalchemy/event.py b/lib/sqlalchemy/event.py index 0fcc8ef49..7c2b49ce8 100644 --- a/lib/sqlalchemy/event.py +++ b/lib/sqlalchemy/event.py @@ -78,20 +78,17 @@ class _Dispatch(object): self._parent_cls = _parent_cls def __reduce__(self): - return _UnpickleDispatch(), (self._parent_cls, ) - @property - def _descriptors(self): - return (getattr(self, k) for k in dir(self) if _is_event_name(k)) - def _update(self, other, only_propagate=True): """Populate from the listeners in another :class:`_Dispatch` object.""" - for ls in other._descriptors: + for ls in _event_descriptors(other): getattr(self, ls.name)._update(ls, only_propagate=only_propagate) +def _event_descriptors(target): + return [getattr(target, k) for k in dir(target) if _is_event_name(k)] class _EventMeta(type): """Intercept new Event subclasses and create |
