All help appreciated. The following is my data model. The idea here is
that a *Story* can be comprised of many pages. One, and only one, of those
pages may be the starting point of the story. I attempted to model this via
a MultipleJoin (pages in a story), a ForeignKey(to map to a single page for
a story), and a link back from the Page using a ForeignKey.
class Story(SQLObject):
"""
Contains the first page, and meta about a story.
"""
title=UnicodeCol(alternateID=True, length=100)
summary=UnicodeCol()
pages=MultipleJoin('Page')
first_page=ForeignKey('Page', default=None) #without this, model works
#alternate, but feels like a kludge: first_page=IntCol(default=0)
class Page(SQLObject):
"""
A page in a story.
"""
short_title=UnicodeCol(alternateID=True, length=20)
text=UnicodeCol()
story=ForeignKey('Story', default=None)
I clearly don't understand what's going on under the hood. Should I just be
using an IntCol as I indicated?
Mike
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss