[Zope3-Users] Weird behaviour of ViewPageTemplateFile()

Albertas Agejevas alga at pov.lt
Thu Apr 10 09:43:14 EDT 2008


On Thu, Apr 10, 2008 at 03:22:33PM +0200, Martin J. Laubach wrote:
>   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

Well, it's called a *View*PageTemplate for a reason :-) If the file is
really empty and you do not need to pass any arguments to it (view,
context, request), use a plain PageTemplateFile
(zope.pagetemplate.pagetemplatefile.PageTemplateFile).

Albertas


More information about the Zope3-users mailing list