diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-30 14:22:43 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-30 14:22:43 -0500 |
| commit | 426c4356eba28f8bb25b7685e43e49e2ed1131e6 (patch) | |
| tree | cbb0ac64aa40905e96005393636a153217d724ba /examples/custom_attributes | |
| parent | ecf1571ba79a81567428d345a4ec10255305de97 (diff) | |
| download | sqlalchemy-426c4356eba28f8bb25b7685e43e49e2ed1131e6.tar.gz | |
- removes the "on_" prefix.
Diffstat (limited to 'examples/custom_attributes')
| -rw-r--r-- | examples/custom_attributes/listen_for_events.py | 8 |
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" |
