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 that one project has
to get at the model of the other one - either the metadata object, or
the table/column object (you can get at the metadata of any table
using Table.metadata). The problem you're laying out is essentially
one of one project having a dependency on the other, so unless you
wanted to redefine the same Table objects as are in the first project
as in the second project, you'd have an import dependency from the
first one to the second.
as far as importing modules across Turbogears projects, you'd have to
ask on their list how that might be accomplished.
*****
Both the ways work. :)
Just that I will have to maintain a fixed relative path between the
two packages and append the location of one pkg to sys.path while
accessing its model from the other.
JV
On Nov 5, 6:40 am, JV <
JaiVikram.Ve...@gmail.com> wrote:
> 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 discussionhttp://
groups.google.com/group/sqlalchemy/browse_thread/thread/4db84b...