[sqlalchemy] Re: No attribute '_instance_key': Defining primary keys and surrogate primary keys

2008-01-29 Thread Phil Coombs
Works perfectly. Thanks again Michael. On 29 Jan, 20:13, Phil Coombs [EMAIL PROTECTED] wrote: Brilliant. Thanks for that lightning response, workaround and fix. I'll give the code a spin. On 28 Jan, 23:19, Michael Bayer [EMAIL PROTECTED] wrote: hi there - the bug is fixed in r4103,

[sqlalchemy] Re: No attribute '_instance_key': Defining primary keys and surrogate primary keys

2008-01-29 Thread Phil Coombs
Brilliant. Thanks for that lightning response, workaround and fix. I'll give the code a spin. On 28 Jan, 23:19, Michael Bayer [EMAIL PROTECTED] wrote: hi there - the bug is fixed in r4103, the test below will work as stated.  Or you   can stick with the workaround for now. On Jan 28, 2008,

[sqlalchemy] Re: No attribute '_instance_key': Defining primary keys and surrogate primary keys

2008-01-28 Thread Michael Bayer
Hi Phil - im going to run this locally to see whats up - my immediate intution is that it has something to do with the Column objects you are using to override those loaded from the autoload=True since thats the only thing here that is at all unusual...maybe try not using autoload=True

[sqlalchemy] Re: No attribute '_instance_key': Defining primary keys and surrogate primary keys

2008-01-28 Thread Michael Bayer
hey Phil - reflection bug. Heres a workaround for now: orders_table = Table('orders', metadata, Column('order_id', Integer, Sequence('orders_order_id_seq'), primary_key=True), autoload=True) On Jan 28, 2008, at 4:03 PM, Phil Coombs wrote: Hi I'm a Python and SA newbie

[sqlalchemy] Re: No attribute '_instance_key': Defining primary keys and surrogate primary keys

2008-01-28 Thread Michael Bayer
OK, i missed that order_id is not a PK and is kind of a surrogate non-primary key column. So, yes you've touched upon something here we've never been asked to support explicitly before. The bug is actually within the mapper that it wants to post-fetch the value of that column in order

[sqlalchemy] Re: No attribute '_instance_key': Defining primary keys and surrogate primary keys

2008-01-28 Thread Michael Bayer
hi there - the bug is fixed in r4103, the test below will work as stated. Or you can stick with the workaround for now. On Jan 28, 2008, at 4:03 PM, Phil Coombs wrote: Hi I'm a Python and SA newbie investigating SA for a project using Postgres. I have a database schema that I want to