[Zope3-Users] Specialized URL traversal.. Best way?

Marius Gedminas mgedmin at b4net.lt
Sat Dec 31 05:49:10 EST 2005


On Thu, Dec 29, 2005 at 11:22:28PM -0700, Jeff Shell wrote:
> Again, this is to have URLs like:
> 
> myapp/@@tags/zope/viewlet
> 
> And turn that into a catalog search for anyof {'zope', 'viewlet'}
> 
>     def publishTraverse(self, request, name):
>         namestack = request.getTraversalStack()
>         if name not in namestack:
>             namestack.append(name)
>         namestack.reverse()
>         tags = tuple(namestack)
>         request.setTraversalStack([])
> 
>         results = TaggedArticleFinder(self.__name__,self.__parent__,tags)
>         results.prepareSearch(request)
>         return results
> 
> The 'TaggedArticleFinder' then provides an interface that a view can
> be found for that displays the results. So I've got it all working
> now...

My coworker Albertas recently implemented something like this in
SchoolTool (I've CCed him).  Unfortunately it turned out to have some
unforeseen consequences, for example, request.URL does not contain the
path elements you "eat" manually, breaking self-posting forms (those
that use <form tal:attributes="action request/URL">) and our login
mechanism.

> I was wondering - is this the best way to do this? Is there a better
> recipe floating around out there?

I would also like to know that.

Marius Gedminas
-- 
Any sufficiently advanced Operating System is indistinguishable from Linux.
		-- Jim Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051231/cd01da21/attachment.bin


More information about the Zope3-users mailing list