[Zope-CMF] Re: Five views / redirects

pete computer-project at hotmail.co.uk
Wed Oct 19 15:32:41 EDT 2005


>     tuesday_pt = ZopeTwoPageTemplateFile('tuesday.pt')
> 
>     def __call__(self):
>         if self.isTuesday():
>             return self.tuesday_pt()
>         return self.index()

Thanks for this, it captures exactly what I wanted to do!  It also means 
that the ZCML provides a clear picture of what the view actually 
provides, rather than providing meaningless 'disabled' views that cloud 
things over a bit.

Should anyone be googling this, you can save yourself 30 minutes or so 
by doing

from Products.Five.pagetemplatefile import ZopeTwoPageTemplateFile

rather than importing anything from the PageTemplate package itself.



More information about the Zope-CMF mailing list