[sqlalchemy] Re: last_inserted_ids and ORM

2009-05-07 Thread Mike Conley
Ahh yes, I use autoflush almost exclusively and forget that you can separate the flush() and commit(). -- Mike Conley On Tue, May 5, 2009 at 6:31 PM, Michael Bayer wrote: > > Mike Conley wrote: > > Does the idea of last_inserted_ids exist for ORM? > > > > I do > > session.add(someobj) >

[sqlalchemy] Re: last_inserted_ids and ORM

2009-05-05 Thread Michael Bayer
Mike Conley wrote: > Does the idea of last_inserted_ids exist for ORM? > > I do > session.add(someobj) > session.commit() > and then want the id of the newly inserted object. > > I can reference > someobj.id > but this generates a select call to the database get the id before yo