[Zope] View classes based on Page Templates in Zope2

Peter Bengtsson peter at fry-it.com
Sun Nov 12 07:12:42 EST 2006


Something I like about Zope3 is the View classes.
What I like about it especially is that it's a brilliant place for 
putting in little extra silly python methods that are specific to your 
template rather than the object class. Eg.

class ViewProduct(BrowserPage):
     __call__=ViewPageTemplateFile('productview.pt')
     def showPrice(self, product):
         return "£%.2f" % product.getPrice()

What options do we have for this in Zope2?
If Five is the answer, what options do we have without Five?

Has anybody written a convenient class like this? Perhaps based in 
PageTemplateFile or something?

-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com


More information about the Zope mailing list