On Jul 16, 12:50 am, [EMAIL PROTECTED] wrote:
> i was talking of renaming the column-names of SA/app, not those in the
> db. see key arg of Column():

Thanks for the tip! I tried it and that works too.

For reference, here is what my "renaming the SA columns"
implementation looks like:


person_table = Table("persons", __meta__,
        Column("id", Integer, primary_key=True, key="person_id"),
        Column("name", String(80)),
        )

employee_table = Table("employees", __meta__,
        Column("id", Integer, primary_key=True),
        Column("salary", Integer),
        Column("person_id", Integer, ForeignKey("persons.person_id")),
        )


I found out that by doing so, we now have a composite primary key
[person_id, id], so we also need to change the get calls to the
following:


alice1 = query.get([1,2])
bob = query.get([2,3])
alice2 = query.get([1,2])



Cheers and thanks again for the replies.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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