Re: [Zope3-Users] Re: Checking if an interface is provided by an object or could be adapted to

2006-05-03 Thread Dominik Huber
Bernd Dorn wrote: On 01.05.2006, at 01:55, Stephan Richter wrote: On Sunday 30 April 2006 19:34, Bernd Dorn wrote: component.queryMultiAdapter((bar,baz), IFoo) is not None or False this way you always get True or False ok, for this case it is ok but when you have a class that uses __conf

Re: [Zope3-Users] Re: Checking if an interface is provided by an object or could be adapted to

2006-05-01 Thread Gary Poster
On May 1, 2006, at 2:56 AM, Bernd Dorn wrote: On 01.05.2006, at 01:55, Stephan Richter wrote: On Sunday 30 April 2006 19:34, Bernd Dorn wrote: component.queryMultiAdapter((bar,baz), IFoo) is not None or False this way you always get True or False ok, for this case it is ok but when you

Re: [Zope3-Users] Re: Checking if an interface is provided by an object or could be adapted to

2006-04-30 Thread Bernd Dorn
On 01.05.2006, at 01:55, Stephan Richter wrote: On Sunday 30 April 2006 19:34, Bernd Dorn wrote: component.queryMultiAdapter((bar,baz), IFoo) is not None or False this way you always get True or False ok, for this case it is ok but when you have a class that uses __conform__ None may be r

Re: [Zope3-Users] Re: Checking if an interface is provided by an object or could be adapted to

2006-04-30 Thread Stephan Richter
On Sunday 30 April 2006 19:34, Bernd Dorn wrote: > component.queryMultiAdapter((bar,baz), IFoo) is not None or False Why not just: component.queryMultiAdapter((bar,baz), IFoo, default=False) Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2

Re: [Zope3-Users] Re: Checking if an interface is provided by an object or could be adapted to

2006-04-30 Thread Bernd Dorn
On 01.05.2006, at 00:39, Martin Aspeli wrote: On Sun, 30 Apr 2006 23:31:37 +0100, Bernd Dorn [EMAIL PROTECTED]> wrote: i would use return IFoo(context, False) is not False or False Aha, didn't know you could do that. Thanks :) How do I do that for multi-adapters, though? you can't do th

[Zope3-Users] Re: Checking if an interface is provided by an object or could be adapted to

2006-04-30 Thread Martin Aspeli
On Sun, 30 Apr 2006 23:31:37 +0100, Bernd Dorn <[EMAIL PROTECTED]> wrote: i would use return IFoo(context, False) is not False or False Aha, didn't know you could do that. Thanks :) How do I do that for multi-adapters, though? Martin -- "You can just adapt yourself out of it..." // Archi