13 Jun
2011
13 Jun
'11
2:26 p.m.
Hiya, Am 12.06.2011, 22:48 Uhr, schrieb Chris McDonough <chrism@plope.com>:
from zope.component.registry import Components c = Components() from zope.interface import Interface, implements class IFoo(Interface): pass ... class Foo(object): ... implements(IFoo) ... foo = Foo() c.queryAdapter(IFoo, foo) <None>
In order to get the object itself back from such an adaptation, you need to use the default= argument.
I know that the question has been answered but your question makes me ask another: why would you want to adapt an object with itself? Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-600-3657 Mobile: +49-178-782-6226