On Mar 14, 2013, at 3:40 AM, Julien Cigar <jci...@ulb.ac.be> wrote: > Hello, > > Stupid question on events: > > If I have event.listen(Folder.default_order, 'set', > validate_default_order_listener), is the listener supposed to be recursively > called if I'm doing something like Folder.default_order = [ ... ] in my > listener function? > > Should I use retval=True and return the new value if I want to modify > Folder.default_order in my listener function (something like > Folder.default_order = mynewlist)?
if you have a list attribute, the "set" event isn't used, it uses the "append" event, even if you assign a collection to it like that. Those items that are effectively removed will be emitted through the "remove" event. using retval=True will allow you to change items on a per-item basis, but it doesn't work at the level of the whole list. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.