[Zope] AccessRule eats part of my URL

Kristian Thy thy at 42.dk
Wed Jun 23 05:09:09 EDT 2010


On Wed, Jun 23, Kristian Thy wrote:
> 	Dear List,
> 
> How can I make it pick up the right object?

An off-list solution made its way to me:

from zExceptions import Redirect
rewritten_url = context.REQUEST['URL'].replace('foo', 'quux')
rewritten_url += '/' + '/'.join(reversed(context.REQUEST.TraversalRequestNameStack))
query = context.REQUEST['QUERY_STRING']
if query:
  rewritten_url = '%s?%s' % (rewritten_url, query)
raise Redirect, rewritten_url

Thanks.

\\kristian
-- 
... et nemo ex vobis interrogat me: »Quo vadis?«


More information about the Zope mailing list