Inheritance in webapp2

73 views Asked by At

I have a base class defined like this:

class BaseRequestHandler(webapp2.RequestHandler):
    #Either loads pages from memcache or from ndb (or from a jinja template) and then caches them.
    def memcache_loader(page_name):
        #implementation not shown, you could just replace this with "return jinjatemplate"
        pass
    def get(self):
        self.response.out.write(self.memcache_loader(self.__class__.__name__).render())

Then, I have a class that inherits from BaseRequestHandler:

class Index(BaseRequestHandler):
    pass

The thing is, I would expect the Index class to inherit the get method from BaseRequestHandler, but it doesn't, and when I visit Index (which is mapped to \), it doesn't load the index page. Why isn't the inheritance mechanism working?

0

There are 0 answers