[Grok-dev] Would it not be useful to be able to set status code in self.redirect
sebastian at urbantalk.se
Mon Nov 22 05:04:04 EST 2010
Today the redirect convenience method has the signature:
def redirect(self, url)
But it sets the response code (response.setStatus()) and overrides any previously set response code. This means one has to realise that in order to customise the response code (say to a 301 - permanent redirect) one has to do that after the redirect call.
I think it would be useful to also add the response code to the method signature
def redirect(self, url, status_code=303)
so it is easier to understand how to override the response code.
More information about the Grok-dev