Hi Martin > Betreff: [Zope3-Users] Weird behaviour of ViewPageTemplateFile() > > I just stumbled over something that utterly baffles me and > hope someone can point out the absolutely obvious to me. > > I've got a view defined in a configure.zcml that points to this > class: > > class MyView(BrowserView): > def __call__(self): > self.pt = ViewPageTemplateFile('empty.pt') > data = self.pt() > return data > > That works fine. However, I don't really need pt as > instance variable, so I turned it into a local variable: > > class MyView(BrowserView): > def __call__(self): > pt = ViewPageTemplateFile('empty.pt') > data = pt() > return data
try this: pt = ViewPageTemplateFile('empty.pt') return pt(self) Regards Roger Ineichen _______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users