>
> whys that  ?  theres no reason you can't set both on the column.

Ah, my mistake. I kind of assumed a column couldn't be both a foreign
key and a primary key.  I'd also tried autoloading the table and then
specifying that the column was a primary key using:

account_stuff_table = Table('account_stuff', metadata, autoload=True)
account_stuff_table.c.account_id.primary_key = True

which didn't seem to work (after setting up the mapper it didn't use
the account_id column on account_stuff as a PK).

But if I create the table using:
account_stuff_table = Table('account_stuff', metadata,
        Column('account_id', Integer,
ForeignKey('account_ids.account_id'),
            primary_key=True),
        Column('credit', Numeric))

it works (which is good enough to be honest).

Should I be able to specify the column is a PK using the autoload
method call? Maybe I'm just setting the PK wrong?

Ignore the rest of my message. Just me misunderstanding stuff.

Thanks for all your help Michael. Its much appreciated.

Andy


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to