Asad Habib wrote:
Is it possible to pass a variable to RESPONSE.redirect or does the page
name have to be a literal string? I was unable to pass in a variable via
the REQUEST object (i.e. REQUEST.get('pageName')) or the SESSION attribute
of the REQUEST object (i.e. REQUEST.SESSION.get('pageName')). Any help
would be appreciated. Thanks.

How do you mean "unable"? That's not a very good problem description.

RESPONSE.redirect is simply a Python method, and it will take any string you can manage, no matter where it comes from. In fact, I think it would be very difficult to do otherwise.

You must, of course, pass the value of a variable, and not the variable itself. None of the following pose any problem::


 url = "";

 def redir():
   return "";

 urls = {}
 urls['plone'] = "";

 REQUEST.RESPONSE.redirect(urls.get('plone', "/"))

In fact, they should all work identically.

"Building Websites with Plone"

Enfold Systems, LLC
Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to