View classes based on Page Templates in Zope2
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12 Nov 2006, at 13:12, Peter Bengtsson wrote:
What options do we have for this in Zope2? If Five is the answer, what options do we have without Five?
Five is the best answer. Why would you not want to use it? jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFFVxUhRAx5nvEhZLIRApRmAKCXBbwOGqDQXmsbyamJzTyuTC9k1ACcCnht nv3DrWWPVgFVMghh2zPOf5c= =1chr -----END PGP SIGNATURE-----
Jens Vagelpohl wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 12 Nov 2006, at 13:12, Peter Bengtsson wrote:
What options do we have for this in Zope2? If Five is the answer, what options do we have without Five?
Five is the best answer. Why would you not want to use it?
I stated my question badly. I meant, are there any implements OTHER than Five. Just like without Plone there's CPS for example. Perhaps a one dedicated solution just for this particular use case. -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 13 Nov 2006, at 12:21, Peter Bengtsson wrote:
Jens Vagelpohl wrote:
On 12 Nov 2006, at 13:12, Peter Bengtsson wrote:
What options do we have for this in Zope2? If Five is the answer, what options do we have without Five? Five is the best answer. Why would you not want to use it?
I stated my question badly. I meant, are there any implements OTHER than Five. Just like without Plone there's CPS for example. Perhaps a one dedicated solution just for this particular use case.
I still don't understand why you want a separate solution - Five is part of Zope nowadays. Unless you didn't mention that you're using a really ancient Zope version. ;) jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFFWFiPRAx5nvEhZLIRAoxvAJ9mu9aJOemVS6NnsjuIFVUyOpAhUQCfYsMC 3Px70MAV9/mWdfB1XmVmzUo= =Acxz -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter Bengtsson wrote:
Jens Vagelpohl wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 12 Nov 2006, at 13:12, Peter Bengtsson wrote:
What options do we have for this in Zope2? If Five is the answer, what options do we have without Five? Five is the best answer. Why would you not want to use it?
I stated my question badly. I meant, are there any implements OTHER than Five. Just like without Plone there's CPS for example. Perhaps a one dedicated solution just for this particular use case.
This *is* the sweet spot for Five. It ships in the Zope core for just this purpose: to make Zope3 technologies available from within Zope2. Why wouldn't you use Five? Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFWKvF+gerLs4ltQ4RAj5WAJ4vFrWKog/E6DIkv1xYOOgjYTvtrgCeLBcJ uoX6/ytXw+32zpJsBUfrtTI= =mLFk -----END PGP SIGNATURE-----
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
Has anybody written a convenient class like this? Perhaps based in PageTemplateFile or something?
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
Cool. Thanks. I'll have a play. -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
participants (4)
-
Jens Vagelpohl -
Peter Bengtsson -
Philipp von Weitershausen -
Tres Seaver