Heh.  OK, more detail.  The problem is that when I generate the database (using Turbogears, so automatic via tg-admin sql create), I get told I have a circular dependency between Page and Story.  Do I really?  Is this something I have to worry about?

Sorry for the extra email.


Mike

On Sat, Jan 24, 2009 at 6:07 PM, Michael LeSauvage <the.el.tea@gmail.com> wrote:
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