ldng wrote:
> Hi,
>
> I have a little problem and can't get my head what's happening so any
> advice is welcome.
> I define the two table following table in my model :
>
> articles_table = Table('articles', metadata,
> Column('article_id', Integer, primary_key=True),
> Column('author', Integer, ForeignKey('tg_user.user_id')),
> Column('content', Unicode),
> )
>
> posts_table = Table('posts', metadata,
> Column('post_id', Integer, primary_key=True),
> Column('author', Integer, ForeignKey('tg_user.user_id')),
> Column('title', Unicode(255)),
> Column('content', Unicode, nullable=False),
> Column('article_id', Integer, ForeignKey('article.article_id'),
> primary_key=True)
> )
>
> If I define the following mappings :
>
> assign_mapper(session.context, Post, posts_table)
> assign_mapper(session.context, Article, articles_table,
> properties = {'comments':relation(Post)}
> )
>
> I get this error when trying to start the project, at first DB
> operation processed :
>snipt
> keyword arguments) to explicitly specify the join conditions. Nested
> error is "Table 'None.article' not defined"
>
The blackhole problem... it is a singularity that is tripping you up, or
rather a plurality. You are trying to assign a foreign key in your Post
table to 'article.article_id' and there is no 'article' table. Use
'articles' there. Should help.
Cheers.
Paul
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---