[sqlalchemy] locking tables with orm? need to generate PK manually...

2013-10-16 Thread Iain Duncan
Hi folks, I'm working on a legacy database that has some issues with PK generation. The long and short of it is that for now, I need to generate an PK by locking a table, because that's what they've been doing. I'm using the orm, and basically want to be able to use a session briefly with the

Re: [sqlalchemy] locking tables with orm? need to generate PK manually...

2013-10-16 Thread Michael Bayer
On Oct 16, 2013, at 1:38 PM, Iain Duncan iainduncanli...@gmail.com wrote: Hi folks, I'm working on a legacy database that has some issues with PK generation. The long and short of it is that for now, I need to generate an PK by locking a table, because that's what they've been doing. I'm

Re: [sqlalchemy] locking tables with orm? need to generate PK manually...

2013-10-16 Thread Iain Duncan
Thanks Micheal, that's what I hoped! iain On Wed, Oct 16, 2013 at 12:13 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Oct 16, 2013, at 1:38 PM, Iain Duncan iainduncanli...@gmail.com wrote: Hi folks, I'm working on a legacy database that has some issues with PK generation. The long

Re: [sqlalchemy] locking tables with orm? need to generate PK manually...

2013-10-16 Thread Jonathan Vanasco
FYI , you can also drop SqlAlchemy core/engine commands within the `connection.execute()` and reference the ORM connection.execute( model.core.Client.__table__\ .update()\ .where( model.core.Client.id == id )\ .values( lastupdate = NOW() ) ) it's a little