Re: [sqlalchemy] Composite foreign keys which has common parent foreign key in SQLalchemy

2015-06-26 Thread Kevin Qiu
Yes, the problem was to implement polymorphic relationship. The relationship() was a misunderstanding, I thought I need to specify it still explicitly. The user to staff is one to one relationship, so is the user to student. I changed my design so the email act as primary key instead, and set staff

Re: [sqlalchemy] Composite foreign keys which has common parent foreign key in SQLalchemy

2015-06-25 Thread Mike Bayer
On 6/25/15 2:08 PM, Kevin Qiu wrote: In the SQLalchemy documentation , it states "It is standard practice that the same column is used for both the role of primary key as well as fo

[sqlalchemy] Composite foreign keys which has common parent foreign key in SQLalchemy

2015-06-25 Thread Kevin Qiu
In the SQLalchemy documentation , it states "It is standard practice that the same column is used for both the role of primary key as well as foreign key to the parent table, and that the col