summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-02-11 18:23:35 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-02-11 18:23:35 +0000
commit60dd7842f012c7aaaa534ce22be06b0db25d86df (patch)
tree8272b3635b445bcd2ddb2a7397eae3df41d546ca /examples
parenta9817ae244266a773cd6565cb61adccef7221cd2 (diff)
downloadsqlalchemy-60dd7842f012c7aaaa534ce22be06b0db25d86df.tar.gz
- Added "post_configure_attribute" method to InstrumentationManager,
so that the "listen_for_events.py" example works again. [ticket:1314]
Diffstat (limited to 'examples')
-rw-r--r--examples/custom_attributes/listen_for_events.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/custom_attributes/listen_for_events.py b/examples/custom_attributes/listen_for_events.py
index c028e0fb4..de28df5b3 100644
--- a/examples/custom_attributes/listen_for_events.py
+++ b/examples/custom_attributes/listen_for_events.py
@@ -7,11 +7,10 @@ across the board.
from sqlalchemy.orm.interfaces import AttributeExtension, InstrumentationManager
class InstallListeners(InstrumentationManager):
- def instrument_attribute(self, class_, key, inst):
+ def post_configure_attribute(self, class_, key, inst):
"""Add an event listener to an InstrumentedAttribute."""
inst.impl.extensions.insert(0, AttributeListener(key))
- return super(InstallListeners, self).instrument_attribute(class_, key, inst)
class AttributeListener(AttributeExtension):
"""Generic event listener.