summaryrefslogtreecommitdiff
path: root/examples/custom_attributes
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-12-30 14:22:43 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-12-30 14:22:43 -0500
commit426c4356eba28f8bb25b7685e43e49e2ed1131e6 (patch)
treecbb0ac64aa40905e96005393636a153217d724ba /examples/custom_attributes
parentecf1571ba79a81567428d345a4ec10255305de97 (diff)
downloadsqlalchemy-426c4356eba28f8bb25b7685e43e49e2ed1131e6.tar.gz
- removes the "on_" prefix.
Diffstat (limited to 'examples/custom_attributes')
-rw-r--r--examples/custom_attributes/listen_for_events.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/custom_attributes/listen_for_events.py b/examples/custom_attributes/listen_for_events.py
index 0cf014c82..2899f7fb1 100644
--- a/examples/custom_attributes/listen_for_events.py
+++ b/examples/custom_attributes/listen_for_events.py
@@ -16,9 +16,9 @@ def configure_listener(class_, key, inst):
def set_(instance, value, oldvalue, initiator):
instance.receive_change_event("set", key, value, oldvalue)
- event.listen(inst, 'on_append', append)
- event.listen(inst, 'on_remove', remove)
- event.listen(inst, 'on_set', set_)
+ event.listen(inst, 'append', append)
+ event.listen(inst, 'remove', remove)
+ event.listen(inst, 'set', set_)
if __name__ == '__main__':
@@ -38,7 +38,7 @@ if __name__ == '__main__':
Base = declarative_base(cls=Base)
- event.listen(Base, 'on_attribute_instrument', configure_listener)
+ event.listen(Base, 'attribute_instrument', configure_listener)
class MyMappedClass(Base):
__tablename__ = "mytable"