[sqlalchemy] Inheritance problem: how to configure a relation with a child, but without the parent?

2009-05-18 Thread fleong
I am trying to configure the following relationships: table1 -1---N- table2 ___|___- type | | table_ex22 1--N- table21 table22 paste my code here. When relate a instance of Table22 with the

[sqlalchemy] Re: Inheritance problem: how to configure a relation with a child, but without the parent?

2009-05-18 Thread fleong
mayo, 22:30, Michael Bayer mike...@zzzcomputing.com wrote: have you tried not using 0 for a primary key ?   i feel like that   might be getting in the way. On May 18, 2009, at 3:59 PM, fleong wrote: Sorry for the delay. Yes, i want to reference Table22, the 'correct' code is as follows

[sqlalchemy] Re: Inheritance problem: how to configure a relation with a child, but without the parent?

2009-05-18 Thread fleong
id gives you two rows.  it   has nothing to do with the relation() or anything else. On May 18, 2009, at 3:59 PM, fleong wrote: from sqlalchemy import * from sqlalchemy.orm import * engine = create_engine('sqlite:///',echo = True) metadata = MetaData() table_1 =  \ Table