On Sep 28, 2008, at 8:23 PM, Mike Bernson wrote:
> > The set method has changed from 0.5b3 to 0.5rc1. > > The old set method set the value before it called the set method > in attribute extension. The new method set the value after the > set method is called. > > This is cause me problems because the methods that I am dispatching > to think the attribute is set. Is it safe in the set method of the > attribute method to set the attribute value by doing a follow: > > class ReceiveEvents(AttributeExtension): > > def set(self, obj, child, oldchild, initiator): > key = initiator.key > obj.dict[key] = child > > > if child != oldchild: > instance = obj.obj.__call__() > instance.notify(model=instance, property=key, > old=oldchild, new=newchild) > > return obj.dict[key] > > instance.notify dispatch to methods that have register that they need > to known about property changing value. The methods that get dispatch > then can modify the property. oh yeah. I think I meant to let you know about this (you're the only person using AttributeExtension) but i probably forgot :) . The change is necessary so that the extension can raise errors or modify the value before its actually set. whats the question, you want to populate dict directly ? Should be fine for scalar attributes since thats what happens right after the event anyway. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---