summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/event
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/event')
-rw-r--r--lib/sqlalchemy/event/api.py10
-rw-r--r--lib/sqlalchemy/event/legacy.py14
2 files changed, 1 insertions, 23 deletions
diff --git a/lib/sqlalchemy/event/api.py b/lib/sqlalchemy/event/api.py
index 6bd63ceca..b36c448ce 100644
--- a/lib/sqlalchemy/event/api.py
+++ b/lib/sqlalchemy/event/api.py
@@ -61,9 +61,6 @@ def listen(target, identifier, fn, *args, **kw):
event.listen(Mapper, "before_configure", on_config, once=True)
- .. versionadded:: 0.9.4 Added ``once=True`` to :func:`.event.listen`
- and :func:`.event.listens_for`.
-
.. warning:: The ``once`` argument does not imply automatic de-registration
of the listener function after it has been invoked a first time; a
listener entry will remain associated with the target object.
@@ -128,9 +125,6 @@ def listens_for(target, identifier, *args, **kw):
do_config()
- .. versionadded:: 0.9.4 Added ``once=True`` to :func:`.event.listen`
- and :func:`.event.listens_for`.
-
.. warning:: The ``once`` argument does not imply automatic de-registration
of the listener function after it has been invoked a first time; a
listener entry will remain associated with the target object.
@@ -173,8 +167,6 @@ def remove(target, identifier, fn):
propagated to subclasses of ``SomeMappedClass``; the :func:`.remove`
function will revert all of these operations.
- .. versionadded:: 0.9.0
-
.. note::
The :func:`.remove` function cannot be called at the same time
@@ -206,8 +198,6 @@ def remove(target, identifier, fn):
def contains(target, identifier, fn):
"""Return True if the given target/ident/fn is set up to listen.
- .. versionadded:: 0.9.0
-
"""
return _event_key(target, identifier, fn).contains()
diff --git a/lib/sqlalchemy/event/legacy.py b/lib/sqlalchemy/event/legacy.py
index f63c7d101..14115d377 100644
--- a/lib/sqlalchemy/event/legacy.py
+++ b/lib/sqlalchemy/event/legacy.py
@@ -96,8 +96,7 @@ def _standard_listen_example(dispatch_collection, sample_target, fn):
else:
current_since = None
text = (
- "from sqlalchemy import event\n\n"
- "# standard decorator style%(current_since)s\n"
+ "from sqlalchemy import event\n\n\n"
"@event.listens_for(%(sample_target)s, '%(event_name)s')\n"
"def receive_%(event_name)s("
"%(named_event_arguments)s%(has_kw_arguments)s):\n"
@@ -105,17 +104,6 @@ def _standard_listen_example(dispatch_collection, sample_target, fn):
"\n # ... (event handling logic) ...\n"
)
- if len(dispatch_collection.arg_names) > 3:
- text += (
- "\n# named argument style (new in 0.9)\n"
- "@event.listens_for("
- "%(sample_target)s, '%(event_name)s', named=True)\n"
- "def receive_%(event_name)s(**kw):\n"
- " \"listen for the '%(event_name)s' event\"\n"
- "%(example_kw_arg)s\n"
- "\n # ... (event handling logic) ...\n"
- )
-
text %= {
"current_since": " (arguments as of %s)" % current_since
if current_since