<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Brandon Craig Rhodes wrote:
<blockquote cite="mid:874p9gk3ti.fsf@ten22.rhodesmill.org" type="cite">
  <pre wrap="">Kevin Smith <a class="moz-txt-link-rfc2396E" href="mailto:kevin@mcweekly.com">&lt;kevin@mcweekly.com&gt;</a> writes:

  </pre>
  <blockquote type="cite">
    <pre wrap="">(Brandon I think I may have a few ideas to bounce of off you to
expand megrok.trials, email if you're interested)
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Yes!  I'd love to hear ideas.  If you'd like, please insult it and
suggest improvements right here on the list in front of everyone, :-)
so that as many ideas and perspectives as possible can be offered.

Start a new thread with "Trails" in the name, though. :-)

  </pre>
</blockquote>
(I suppose theirs no room for introverts in open source anymore)<br>
<br>
I think megrok.trails is great,&nbsp; my thoughts on a way of expanding it
are along the lines of the following.<br>
<br>
<pre>class MyTrails(megrok.trails.TrailHead):
    grok.context(MyApp)
    grok.name('mytrails') #default from class name

    # the trails attribute is left blank

class News(grok.View):
    grok.context(megrok.trails.TrailStop)
    grok.name('mytrails::/news') #signifys MyTrails as trail head and /news as child url


class Archive(grok.View):
    grok.context(megrok.trails.TrailStop)
    grok.name('mytrails::/news/archive') # another page


class Archives(grok.View):
    grok.context(megrok.trails.TrailStop)
    grok.name('mytrails::/news/archive/++subpath++') # stuffs remaining url parts
    # as signifyed by ++subpath++ into self.subpath Zope2 style

    def year(self):
        return self.subpath[-1]

    def month(self):
        return self.subpath[-2]

</pre>
In my own code, I use grok.context(Traversable) instead of TrailStop,
but I want to retain the metaphor here. There's lots of room for
improvement, but I think you can get the drift. <br>
<br>
It's pretty concise and easy to use. I've been using something similar
successfully for over a year.<br>
<br>
Kevin Smith<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>