[Grok-dev] Re: grok.View: Self-submitting forms, redirect, and before()

Philipp von Weitershausen philipp at weitershausen.de
Fri Jan 12 09:24:02 EST 2007


Suresh V wrote:
> Christian Theune wrote:
>>>
>>>       def __call__(self):
>>> -        self.before()
>>> +        self.update()
>>> +        if self.request.response.getStatus() in (302, 303):
> 
> Could the above be better dealt with as an exception? Who will be 
> setting this status?

You would be setting the status indirectly by 
response.redirect('some-other-place') within self.update(). You can also 
raise zope.publisher.interfaces.Redirect, but that needs no special 
handling as the exception will propagate all the way to the publisher 
anyway.


-- 
http://worldcookery.com -- Professional Zope documentation and training
2nd edition of Web Component Development with Zope 3 is now shipping!


More information about the Grok-dev mailing list