[Zope3-Users] configure.zcml entries for using adapters.

Vijay Nakhawa vijay.nakhawa at gmail.com
Sat Nov 12 03:56:27 EST 2005


I am struggler in learning zope3.
Please forgive me if i am wrong.
How about using an intermediate view component?

in template1.pt

<div tal:content= view/vgetTotalDistance />

In zcml

<browser:page
 class=".someModule.RoughView"
 template = "template1.pt"
.....
/>

where view class is :

from adapters import CarTotalDistanceAdapter

class RoughView:

 def __init__(self,context,request):
     self.context = context
     self.request = request
     self.adapt = CarTotalDistanceAdapter()

 def vgetTotalDistance(self):
     return self.adapt.getTotalDistance()


More information about the Zope3-users mailing list