On Dec 11, 2007, at 10:07 AM, King Simon-NFHD78 wrote:
> > I assume the problem is that my date_created column isn't immediately > available at the 'after_insert' stage, because it is generated in the > SQL INSERT statement, but hasn't been read back from the database yet. > Is there a more suitable hook-point than after_insert, where I can > safely read values like this? > this is a thorny issue, while the immediate issue youre having is something that can possibly be smoothed over (probably even by sticking on the _instance_key yourself, not sure if i should recommend that though), its not going to work if say you wanted to look at the foriegn key attributes in an attached collection since they havent been set up yet. also the API youre using with get_history() has changed in trunk, itll give you a tuple now of (added, unchanged, deleted). there is the notion of SessionExtension which has an after_commit() hook, not sure if that is a viable option here. I cant go too nuts with all these extension hooks since they all add latency to everything (sorta wishing there were a lot less hooks as it is). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---