[Grok-dev] Re: issue #226555: viewlet.url() and how to solve it

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu May 8 15:39:54 EDT 2008


Leonardo Rochael Almeida wrote:
> On Thu, May 8, 2008 at 3:48 PM, Kevin Smith <kevin at mcweekly.com> wrote:
>>
>> [...]
>> class ViewletBase(BrowserView):
>>   """Viewlet adapter class used in meta directive as a mixin class."""
>>
>>   zope.interface.implements(interfaces.IViewlet)
>>
>>   def __init__(self, context, request, view, manager):
>>       super(ViewletBase, self).__init__(context, request)
>>       self.__parent__ = view
>>       self.context = context
>>       self.request = request
>>       self.manager = manager
>>
>> Looks like __parent__ is the view, and manager is the viewletmanager.... I'm
>> not sure the viewlet is actually accessible here at all.
> 
> The viewlet is accessible as "self" :-) the view is
> self.__parent__.__parent__, right?

I would say, self.__parent__ is the view the viewlet was registered for.

regards,
jw



More information about the Grok-dev mailing list