Is there any reason why I would expect after_update to be called but
before_update to never be called?

What is responsible for creating the .methods property on the
extension?  I'm creating it by hand so that I can manually set the
extension property of a mapper after the fact.  But there's nothing in
the documentation to suggest that this property is necessary for
correct behavior.

I would humbly suggest that this ought to be a property on
MapperExtension that creates that list if it doesn't already exist.
Whoever is creating it now is difficult enough to track down that I
gave up after about 30 minutes of tracing code.

Regards,
Ross

class MyExtension(MapperExtension):

    def __init__(self):
        # KLUDGE rab: added to avert error in sqlalchemy.orm.query
"FulltextUpdate has no attribute 'methods'"
        MapperExtension.__init__(self)
        self.methods = ('after_insert', 'after_update',
'before_delete')

    def after_insert(self, mapper, connection, instance):
        log.debug('after_insert() ran')
        return EXT_CONTINUE;

    def after_update(self, mapper, connection, instance):
        log.debug('before_update() ran')
        return EXT_CONTINUE;

    def before_delete(self, mapper, connection, instance):
        log.debug('before_delete() ran')
        return EXT_CONTINUE;

SomeClass.mapper.extension = MyExtension()

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to