Where do I go to search the archives of this list? I need to redirect from a zpt to another page, if request does not have a specific key. I have googled and read the zope book and tried every variation I can think of... now I just feel stupid. How do I get a tal:condition to call response.redirect if request.has_key(myval) is false ? -- Les Ferguson Software developer Waitakere, NZ
Les Ferguson wrote:
Where do I go to search the archives of this list?
goggle with 'search zope list' and feel lucky: http://www.zope.org/Resources/MailingLists
I need to redirect from a zpt to another page, if request does not have a specific key. I have googled and read the zope book and tried every variation I can think of... now I just feel stupid.
How do I get a tal:condition to call response.redirect if request.has_key(myval) is false ?
-- David Convent
Something like this at the top of your ZPT: <tal:block tal:condition="exists:request/myval"> <tal:block tal:define="redir python:request.RESPONSE.redirect(myurl)" /> </tal:block> --David Les Ferguson wrote:
Where do I go to search the archives of this list?
I need to redirect from a zpt to another page, if request does not have a specific key. I have googled and read the zope book and tried every variation I can think of... now I just feel stupid.
How do I get a tal:condition to call response.redirect if request.has_key(myval) is false ?
-- David Chandek-Stark Web Applications Developer Duke University - Perkins Library (919) 660-5859 dc@duke.edu
Sorry, guess I meant this: <tal:block tal:condition="python:not request.has_key(myval)"> <tal:block tal:define="redir python:request.RESPONSE.redirect(myurl)" /> </tal:block> David Chandek-Stark wrote:
Something like this at the top of your ZPT:
<tal:block tal:condition="exists:request/myval"> <tal:block tal:define="redir python:request.RESPONSE.redirect(myurl)" /> </tal:block>
--David
Les Ferguson wrote:
Where do I go to search the archives of this list?
I need to redirect from a zpt to another page, if request does not have a specific key. I have googled and read the zope book and tried every variation I can think of... now I just feel stupid.
How do I get a tal:condition to call response.redirect if request.has_key(myval) is false ?
-- David Chandek-Stark Web Applications Developer Duke University - Perkins Library (919) 660-5859 dc@duke.edu
David Chandek-Stark wrote:
<tal:block tal:condition="python:not request.has_key(myval)"> <tal:block tal:define="redir python:request.RESPONSE.redirect(myurl)" /> </tal:block>
Thanx, that is pretty much where I got to, only the page kept going thud because of a call further down the page that relied on the missing 'myval' key. Its like its evaluating & building the entire page before carrying out the redirect ? I moved the logic into a python script instead eventually. That seemed to be the most common recommendation among all the google hits anyway. -- Les Ferguson Software developer Waitakere, NZ
participants (3)
-
David Chandek-Stark -
David Convent -
Les Ferguson