summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/events.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-17 19:59:45 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-17 19:59:45 -0500
commit7dab4ae6a9ca057bb99be2f01efc26610be12f63 (patch)
tree69e2a7a7bca8899c6fa44616c919cf3b232cb3a0 /lib/sqlalchemy/events.py
parente7c5fd7b22dd21ec1c1cac177b9ee611779903e3 (diff)
downloadsqlalchemy-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/events.py')
-rw-r--r--lib/sqlalchemy/events.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/sqlalchemy/events.py b/lib/sqlalchemy/events.py
index fe9c5dda1..6435ff3f2 100644
--- a/lib/sqlalchemy/events.py
+++ b/lib/sqlalchemy/events.py
@@ -279,8 +279,8 @@ class PoolEvents(event.Events):
"""
-class EngineEvents(event.Events):
- """Available events for :class:`.Engine`.
+class ConnectionEvents(event.Events):
+ """Available events for :class:`.Connection`.
The methods here define the name of an event as well as the names of members that are passed to listener functions.
@@ -307,12 +307,7 @@ class EngineEvents(event.Events):
@classmethod
def _listen(cls, target, identifier, fn, retval=False):
- from sqlalchemy.engine.base import Connection, \
- _listener_connection_cls
- if target.Connection is Connection:
- target.Connection = _listener_connection_cls(
- Connection,
- target.dispatch)
+ target._has_events = True
if not retval:
if identifier == 'before_execute':