diff options
Diffstat (limited to 'lib/sqlalchemy/event/api.py')
-rw-r--r-- | lib/sqlalchemy/event/api.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/event/api.py b/lib/sqlalchemy/event/api.py index ddbf05cfe..270e95c9c 100644 --- a/lib/sqlalchemy/event/api.py +++ b/lib/sqlalchemy/event/api.py @@ -25,7 +25,8 @@ def _event_key(target, identifier, fn): return _EventKey(target, identifier, fn, tgt) else: raise exc.InvalidRequestError("No such event '%s' for target '%s'" % - (identifier, target)) + (identifier, target)) + def listen(target, identifier, fn, *args, **kw): """Register a listener function for the given target. @@ -114,14 +115,15 @@ def remove(target, identifier, fn): event.remove(SomeMappedClass, "before_insert", my_listener_function) Above, the listener function associated with ``SomeMappedClass`` was also - propagated to subclasses of ``SomeMappedClass``; the :func:`.remove` function - will revert all of these operations. + propagated to subclasses of ``SomeMappedClass``; the :func:`.remove` + function will revert all of these operations. .. versionadded:: 0.9.0 """ _event_key(target, identifier, fn).remove() + def contains(target, identifier, fn): """Return True if the given target/ident/fn is set up to listen. |