> > i have some pre_save automatic operations and decided MVC-like to > > split them into 2 phases - a per-object validation-only that goes > > at save(), and a per-flush set-up 2nd phase for putting > > timestamps etc. The 2nd one is via > > SessionExtension.before_flush(). > > i'm looking at the session state at that time: > > - what is the list of all instances going to be changed? > > something like > > all = ses.new() + [ i for i in ses.dirty() if ses.modified(i) ] > > theres a method that tells you "is this *really* modified" called > "session.is_modified(x)". > > > - would this include all relation-cascaded items or not? > > it wont include changes on foreign key columns nor every kind of > "orphaned" object. orphans i dont care, but the rest... So at what time these are available - after_flush? or before_commit?
there isn't going to be deletion... and there isnt going to be much update either... both mostly mean insert new version, with all the many2many links copied anew. i need to iterate over *all* would-be written-to-DB objects, and fix their timestamps. But maybe i need just the *new* objects - explicitly sess.added() or implicitly via relation. would before_flush suffice for them? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---