[Zope3-Users] Re: configure.zcml entries for using adapters.
Vijay Nakhawa
vijay.nakhawa at gmail.com
Sat Nov 12 04:12:14 EST 2005
Sorry there is a bug in line
of class RoughView:
write:===>
self.adapt = CarTotalDistanceAdapter(context)
instead of
self.adapt = CarTotalDistanceAdapter()
On 11/12/05, Vijay Nakhawa <vijay.nakhawa at gmail.com> wrote:
> 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