Thanks for your solutions. However, I've still got some bugs to fix.
My model is as following:

class Wiki(SQLObject):
    wikiname = StringCol(alternateID=True, length=30)
    frontpage = StringCol()
    pages = MultipleJoin('Page')

class Page(SQLObject):
    pagename = StringCol(alternateID=False, length=30)
    data = StringCol()
    wikiId = ForeignKey('Wiki')

This allows wiki names are unique across Wiki table (alternateID=True)
but in Page table, I set alternateID=False, which allows page names to
be repeated as long as they belongs to different wiki (different
wikiId). Say
wikiId = 1, pagename = FrontPage
wikiId = 2, pagename = FrontPage

should be working fine. But it doesn't work for the constraint of same
pagename within a wiki if I do so. Say

wikiId = 1, pagename = FrontPage
wikiId = 1, pagename = FrontPage

is not acceptable.

How can I correct this?

Reply via email to