[sqlalchemy] before_flush event doesn't seem to permit additional update to dirty objects

2012-06-06 Thread Damian Dimmich
Hi, I have a before flush event set up that sets the current user_id and datetime on new objects that are going to be commited to the database (all tables have these fields). Unfortunately, it seems to ignore changes I make to existing objects, ie when I set the user_id (which i get from

Re: [sqlalchemy] before_flush event doesn't seem to permit additional update to dirty objects

2012-06-06 Thread Michael Bayer
The code looks fine to me, other than the access of Session._new for which you should be really calling upon the public new collection. What you might want to make sure of is that the objects you expect to see in dirty are actually there. Sometimes objects don't make it into dirty until they