[Kss-devel] kss and response.redirect

Martin Aspeli optilude at gmx.net
Mon Nov 5 21:48:15 CET 2007


Hedley Roos wrote:
> What happens if I do
> 
> context.REQUEST.RESPONSE.redirect('somewhere_in_plone_site')
> 
> in my Python Script which is invoked through a kss rule?

Nothing, probably. :)

> My example seems dumb, I know - I'm just abstracting a more complex
> use case. Basically I call existing Python Scripts which sometimes
> want to redirect, and then my subsequent core method calls
> (replaceInnerHTML etc) fail.

The response there would tell the browser to redirect to some other 
page. The AJAX request may even do that, I'm not sure, but unless the 
thing you redirected to also returned a KSS payload, the client-side 
handler wouldn't know what to do.

> On the flipside, how do I in fact cause my browser to redirect in said
> Python Script? Can I just set url.location.href (I forget the
> notation)?

Probably, yes.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book



More information about the Kss-devel mailing list