So I am writing my own wiki.  Here are my relevant tables:

class WikiPage(SQLObject):
   name = StringCol(alternateID=True, length=40)
   currentVersion = IntCol(default=None)
   lockedTime = DateTimeCol(default=None)
   lockedPerson = IntCol(default=None)

class WikiData(SQLObject):
   wikiPage = ForeignKey('WikiPage')
   version = IntCol(default=None)
   time = DateTimeCol.now()
   author = ForeignKey('User')
   ipnr = StringCol(default=None) # the ip number of committer
   comment = StringCol(default=None)
   text = StringCol() # the actual text of the page

Now, when I do a simple select like:

x = WikiData.select( WikiData.q.wiki_page_id == 1 ) [:1]

I get:

AttributeError: WikiData instance has no attribute 'wiki_page_id'

When I try replacing wiki_page_id with wiki_page or wikiPage, it still
doesn't work.

But when I use version, it works fine.

How can I make it work?  (This is just the first step to a more
complicated query.)

Thanks
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to