Hi All:

I have a customized page template product which subclasses from
ZopePageTemplate. In this product class, I have a method that redirects to a
certain fixed page that I have created in the ZMI. One of the objects of
this type makes calls to this method and also has some conditional redirects
(based on certain request variables). Here is a representation

In my Product class, I have a method which conditionally redirects ...

def check_and_redirect(self):
    request = self.REQUEST
    if request.get('redirect_to_fixed_page', False):
        request.RESPONSE.redirect('http://somefixedurl_in_my_domain')

def getValue(self):
    self.check_and_redirect()
    # do some more stuff
    ....
    ....
    return 'some value'

My ZPT looks like this ...
...
<tal:call tal:define="data python:mytemplate.getValue()"/>
...
...
...
...
<tal:redir tal:condition="python:here.REQUEST.has_key('var')">
<tal:dummy tal:define="test python:here.REQUEST.RESPONSE.redirect('
http://someotherurl";)"/>
</tal:redir>
...
...
...


What is happeninig is that the redirect in the PT is taking precedence over
my redirect (which Im doing in the method). My question is: Can I make sure
that my redirect takes precedence without modifying the PT itself. Is there
any other ZopePageTemplate method which I can patch so that my own redirect
kicks in first??

Thanks for you time and help.

-AK
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to