[sqlalchemy] Re: Column defaults in MapperExtension.after_insert

2007-12-12 Thread King Simon-NFHD78
Michael Bayer wrote: > 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 th

[sqlalchemy] Re: Column defaults in MapperExtension.after_insert

2007-12-11 Thread Michael Bayer
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 suit

[sqlalchemy] Re: Column defaults in MapperExtension.after_insert

2007-12-11 Thread svilen
> This works nicely for attributes that I set directly. However, it > breaks when it comes across a column that is defined as: > > sa.Column('date_created', sa.DateTime, > default=sa.func.current_timestamp(type=sa.DateTime)) > > The attached script should show the problem. The tr