Hi All,
I'm trying to override the constructor from webapp2.RequestHandler in order to do an automatic list of pages on my webapp. But it's not working.
Here's what I'm trying to do:
class BaseHandler(webapp2.RequestHandler):
def __init__(self, request, response, **kwargs):
self.initialize(request, response)
self.pageName = kwargs['pageName']
class ChildPage(BaseHandler):
[...]
app = webapp2.WSGIApplication([('/',
ChildPage (None,None, dict(pageName='Root Page'))),
But when the page loads, I got the following error:
ERROR 2012-05-01 10:20:31,911 webapp2.py:1553] '
ChildPage ' object is not callable
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1536, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1530, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1065, in __call__
return self.handler(request, *args, **kwargs)
TypeError: '
ChildPage ' object is not callable
I suspect it's related with the None's I pass to the constructor.
Any ideas how to skip this or any other way to achieve what I want??
Thanks,
daniloz