[Zope3-dev] adapter lookup question

Bernd Dorn bernd.dorn at lovelysystems.com
Fri May 11 12:17:22 EDT 2007


On 11.05.2007, at 16:12, Chris Withers wrote:

> Hi All,
>
> I want to lookup a multi-adapter using the following code:
>
> getMultiAdapter((obj1,obj2),ISomething)
>
> I also wanted to have a "backstop" adapter so that the above would  
> never fail, which I tried to register as follows:
>
> <adapter
>   for="* *"
>   provides="ISomething"
>   factory=".something.Something"/>
>
> ...however the getMultiAdapter call still failed with a  
> ComponentLookupError :-(
>
> I had to change the registration as follows:
>
> <adapter
>   for="* .module.BaseClassOfObj2"
>   provides="ISomething"
>   factory=".something.Something"/>
>
> ...to get the getMultiAdapter call to work.
>
> Why do I need to do this?
>

well, i dunno too (maybe a zcml issue), but i thing if you use

<adapter
   for="zope.interface.Interface zope.interface.Interface"
   provides="ISomething"
   factory=".something.Something"/>

it schould work


> cheers,
>
> Chris
>
> -- 
> Simplistix - Content Management, Zope & Python Consulting
>            - http://www.simplistix.co.uk
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub: http://mail.zope.org/mailman/options/zope3-dev/bernd.dorn% 
> 40lovelysystems.com
>



More information about the Zope3-dev mailing list