On Tue, Jan 03, 2006 at 05:37:30PM -0500, Wade Leftwich wrote:
> Marius Gedminas wrote:
> > On Thu, Dec 29, 2005 at 11:22:28PM -0700, Jeff Shell wrote:
> >>Again, this is to have URLs like:
> >>
> >>myapp/@@tags/zope/viewlet
> 
> How about this? It gives
> zope.app.publication.publicationtraverse.PublicationTraverse.traverseName()
> some extra work, but it doesn't mess with the request and leaves
> request.URL reflecting the entire "path".
> 
> ###
> class BrowserViewStopTraversal(BrowserView):
>     implements(IPublishTraverse)
>
>     def __init__(self, context, request):
>         self.context = context
>         self.request = request
>         self.traverse_subpath = []
> 
>     def publishTraverse(self, request, name):
>         self.traverse_subpath.append(name)
>         return self
> 
>     def __call__(self):
>         """Just for example"""
>         return ("traverse_subpath = %s\nrequest.URL = %s" %
>                 (self.traverse_subpath, self.request.URL))

I like it.
 
Marius Gedminas
-- 
The advertisement is the most truthful part of a newspaper.
                -- Thomas Jefferson

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to