Anand Chitipothu wrote:
>> I'm not sure I understand. I thought that you could only run one app
>> at a time. (In 0.3, don't you call app.run()?) If you have subapps,
>> obviously they can inherit 404s from their parent apps.
>
> how about this?
>
> class application:
> ....
> def notfound(self):
> parent = self.get_parent_app()
> if parent:
> return parent.notfound()
> else:
> status = '404 Not Found'
> headers = {'Content-Type': 'text/html'}
> message = "not found"
> return web.HTTPError(status, headers, message)
>
> and use `raise app.notfound()` to raise notfound exception.
> app.notfound can be replaced by a custom function which returns a new
> exception.
app.notfound, that sounds nice. I assume you can also use all the state
variables in web to evaluate the request and suggest new (valid)
requests, etc?
I say aye to this one.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---