[sqlalchemy] Re: foreign key reference between the models of two different TurboGears projects?

2008-11-04 Thread JV
I got a solution. Thanks to Michael. Here is what he suggested. * You use the Column object: from myproject.model import sometable someothertable = Table('someothertable', metadata, Column('foobar', Integer, ForeignKey(sometable.c.foobar)) as you can see the common theme in both cases is

[sqlalchemy] Re: foreign key reference between the models of two different TurboGears projects?

2008-11-04 Thread JV
I got a solution. Thanks to Michael. Here is what he suggested. * You use the Column object: from myproject.model import sometable someothertable = Table('someothertable', metadata, Column('foobar', Integer, ForeignKey(sometable.c.foobar)) as you can see the common theme in both cases is

[sqlalchemy] Re: foreign key reference between the models of two different TurboGears projects?

2008-11-04 Thread JV
Michael Can you elaborate a bit on how to do each of the thing you said - metadata sharing between 2 separate Turbogears projects and placing the actual column in the ForeignKey constructor, instead of string 'table.column.id'. I read your earlier discussion http://groups.google.com/group/sqlalc

[sqlalchemy] Re: foreign key reference between the models of two different TurboGears projects?

2008-11-04 Thread Michael Bayer
either share the same MetaData object across those two models, or place the actual Column object instead of a string in the ForeignKey() constructor. On Nov 4, 2008, at 7:16 AM, JV wrote: > > Hi > > How can I have a foreign key reference between the models of two > different TurboGears proj