[Zope3-Users] Re: Re: viewlets for specific interfaces

Luis De la Parra lparrab at gmx.net
Fri Sep 15 14:24:06 EDT 2006

Stephan Richter wrote:

> ... or something like that. I did not investigate further. Then I changed
> the registration to:
>   <browser:page
>     for="zope.app.file.interfaces.IFile"
>     name="viewlet.html"
>     template="index.pt"
>     permission="zope.View"/>

hmm... I put some debug strings in ViewletManagerBase.__init__ and if I
registered the page for IFile: it works as you said, and I get following
lines on the console:

context =  <zope.app.file.file.File object at 0xb585fe2c> 
view =  <zope.app.pagetemplate.simpleviewclass.SimpleViewClass
from /home/luis/src/z/src/test/index.pt object at 0xb58cffec>

If I switch it back to for="*", then I get this output:

context =  <zope.app.publisher.browser.viewmeta. object at 0xb5774b0c> 
view =  <zope.app.pagetemplate.simpleviewclass.SimpleViewClass
from /home/luis/src/z/src/test/index.pt object at 0xb5774c6c>

so the context passed from the "page object" to the viewlet manager is wrong
(seems wrong to me) and the adapter look-up fails

can you give me a hint why this viewmeta is my context with this kind of
page registration?


More information about the Zope3-users mailing list