We had this code and it worked fine. After working with the refactor, it no longer works. As the comment says, we want to inherit only from the base page if the request is not an ajax request. To do this, we pass the parameter to the template and, based on the parameter, inherit or not.
View.py
class Router(object): def __init__(self, request): self.request = request @view_config(route_name="home") def get(self): template = "home.mak" value = {'isPage':self.request.is_xhr is False} return render_to_response(template, value, request=self.request)
Template.mak
#
Currently, the Undefined error does not have the __ getitem __ attribute. If we change $ {inherit (context)} to $ {inherit (value)}, we get the value of the global variable undefined.
source share