[Twisted-web] Page navigation: a cry for help

Michal Pasternak twisted-web@twistedmatrix.com
Tue, 27 Jan 2004 22:55:19 +0100


Christopher Armstrong [Tue, Jan 27, 2004 at 05:39:19PM -0500]:
> What kind of storage are you using? If it's a filesystem that mirrors 
> the URL structure, you could just look up a modified request.prepath in 
> your file system and look at sibling pages.

I am not using any filesystem. Whole structure is made up of classess in the
code. Currently I have written a custom class, which is a basic of all
classess I create:

class SitePage(page.Page):
    def __init__(self, name = "", label = "", browseable = True):
        page.Page.__init__(self)
        
        self.name = name
        self.label = label
        self.browseable = browseable
        self.parent = None
        self.myChildren = []

    def putChild(self, p):
        page.Page.putChild(self, p.name, p)
        p.parent = self
        self.myChildren.append(p)

... and I can achieve both goals with it, but I don't know if it is the best
method available.