[Grok-dev] Re: GrokPaste: a grok pastebin app

oubiwann duncan.mcgreggor at gmail.com
Tue Mar 27 20:28:57 EDT 2007



On Mar 24, 3:15 am, Philipp von Weitershausen
<phil... at weitershausen.de> wrote:
>
> > Something like this could be nice:
>
> >     def traverse(self, name):
> >         if name == 'tags':
> >             self.viewStackToList('tagsearch')
> >         else:
> >             # try to get the item from the container
> >             return self.context.get(name)
>
> > Either that or some pre-built Traversal components that perhaps expect a
> > URLConfig Model to available?
>
> During the sprint we were pondering about making traverse() take an
> arbitrary length of positional arguments, e.g.:
>
>    def traverse(self, *traverse_subpath):
>       ...

We do something *kind of* like that in Nevow:

    def locateChild(self, context, segments):
        ...

I have found this to be very flexible and allows one to support pretty
much anything you want. I recently blogged about how to use this to do
Django-like traversal in Nevow.

d



More information about the Grok-dev mailing list