[Zope] Re: View classes based on Page Templates in Zope2
Philipp von Weitershausen
philipp at weitershausen.de
Sun Nov 12 15:21:23 EST 2006
Peter Bengtsson wrote:
> 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?
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
--
http://worldcookery.com -- Professional Zope documentation and training
More information about the Zope
mailing list