Tres Seaver wrote:
>>> provideAdapter(adapter,adapts=(None,None),provides=ITest)
>>> getMultiAdapter((1,1),ITest)
Traceback (most recent call last):
...
zope.component.interfaces.ComponentLookupError:
((1, 1), , u'')
Oh dear, what have I done wrong here?
The "order" of your adapter registr
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Chris Withers wrote:
> Marius Gedminas wrote:
>> Now when you try to adapt anything to ITest, zope.component will call
>> your ``adapter`` function and then check the return value. A return
>> value of None means "the adapter is not available", and re
Marius Gedminas wrote:
On Thu, Jan 18, 2007 at 08:55:17AM +, Chris Withers wrote:
Marius Gedminas wrote:
BTW passing interfaces to provideAdapter/ is out of fashion.
This stuff is getting almost perl-ish in it's "there's many ways to do
it, pick the style you like" nature..
There's a sli
Marius Gedminas wrote:
Now when you try to adapt anything to ITest, zope.component will call
your ``adapter`` function and then check the return value. A return
value of None means "the adapter is not available", and results in a
TypeError you see here:
Yes, apologies, both you and Philipp are
On 18 Jan 2007, at 09:53 , Chris Withers wrote:
Philipp von Weitershausen wrote:
If it is, then which of the following should I use to register a
generic adapter for any single object to an interface:
provideAdapter(...,adapts=(None,),...)
This one.
Given that you can register adapters for
On Thu, Jan 18, 2007 at 08:53:36AM +, Chris Withers wrote:
> Philipp von Weitershausen wrote:
> >>If it is, then which of the following should I use to register a
> >>generic adapter for any single object to an interface:
> >>
> >>provideAdapter(...,adapts=(None,),...)
> >
> >This one.
>
> Gi
Philipp von Weitershausen wrote:
If it is, then which of the following should I use to register a
generic adapter for any single object to an interface:
provideAdapter(...,adapts=(None,),...)
This one.
Given that you can register adapters for any class, whether or not it
implements any int
Martin Aspeli wrote:
Chris Withers wrote:
Hi All,
I was wondering if someone could give me a definitive explanation of
what the following means:
No, but this is:
provideAdapter(...,adapts=(Interface, ISomething, Interface),...)
Actually, ZCML translates a "*" to None. And as of Zope 3
Chris Withers wrote:
Hi All,
I was wondering if someone could give me a definitive explanation of
what the following means:
Yes.
If it is, then which of the following should I use to register a generic
adapter for any single object to an interface:
provideAdapter(...,adapts=(None,),...)