Re: Content->Adapter->View question
from
erral
on Apr 02, 2007 02:16 AM
Derek Richardson(e)k dio:
> If I register an adapter from Folder to a new interface (IFeed) and then
> register a view (atom.xml) for the new interface (IFeed), should I be able to
> use the atom.xml view on Folder? Or does the interface (IFeed) have to be
> directly implemented by Folder for me to use the atom.xml view on the folder?
>
> I'm hoping I can get away with not directly implementing the interface on Folder
> using a zcml "interface" tag. I want Zope to simply know that Folder can be
> adapter to IFeed and thus can be used for the view. Otherwise, we get into too
> much configuration, in my opinion...
>
I haven't tested it directly in Zope3, but using the approach of base &
fatsyndication, I had to register the views using zcml.
I think that the point is that when finding a view, Zope3 tries to find
an adapter for the context (IFolder) and request (IRequest?), but never
tries to "do magic" and try each adapter was registered for IFolder and
find then the view.
Regards,
Mikel
--
Mikel Larreategi
mlarreategi@...
CodeSyntax
Azitaingo Industrialdea 3 K
E-20600 Eibar
Tel: (+34) 943 82 17 80