self.context.absolute_url looks very zope2ish, absolute_url is no longer 
inherited, it is an adapted component, so I believe the accepted Zope3 way is...

from import zapi
from import IAbsoluteURL


    def render(self):
        url = zapi.getMultiAdapter( (self.context, self.request), IAbsoluteURL) 
        return "<li>IAbsoluteUrl == %s/</li>" % url


Kevin Smith

----- Original Message ----
From: Christophe Combelles <[EMAIL PROTECTED]>
Sent: Monday, October 2, 2006 7:14:22 PM
Subject: [Zope3-Users] absolute_url  in the viewlet ?


How can I obtain the absolute_url of the context object in a content provider 
in a viewlet ?

For example, in the demo3 of zope3demos, the render() method of the viewlet 
returns  self.context.__name__.
( )

How could I tell it to return the absolute_url instead of the __name__ ?

(self.context.absolute_url gives a ForbiddenAttribute error.)

Zope3-users mailing list

Zope3-users mailing list

Reply via email to