eventually, i find the problem!!!!
ForeignKey should use the same name with the related table.
How simple it is, but I waste a whole day on it!

Worry: post=ForeignKey('postTable')
correct: postTable=ForeignKey('

On Fri, Apr 10, 2009 at 1:17 AM, Oleg Broytmann <> wrote:
On Thu, Apr 09, 2009 at 11:44:52PM +0200, Hanjie wrote:
> class postTable(SQLObject):
>     title = UnicodeCol(length=50)
>     content = UnicodeCol()
>     comments=MultipleJoin('commentTable')
> class commentTable(SQLObject):
>     post=ForeignKey('postTable')
>     authorName=UnicodeCol(length=255,notNull=False)
>     content=UnicodeCol()
> But, when I want to use q.comment, the error arise:
> OperationalError: Unknown column 'post_table_id' in 'where clause'

  The problem lies here:

class postTable(SQLObject):

class commentTable(SQLObject):

  There are simply too many different names: 'comments', 'commentTable',
'post' and 'postTable'. Multitude of these names confuses SQLObject so it
doesn't know how to count comments of a post. One can help SQLObject by
explicitly naming the column in the other table:

class postTable(SQLObject):
   comments=MultipleJoin('commentTable', joinColumn='post_id')

    Oleg Broytmann    
          Programmers don't die, they just GOSUB without RETURN.

This email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
sqlobject-discuss mailing list