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