[Zope3-dev] adaptation based on class rather than interface
Chris Withers
chris at simplistix.co.uk
Thu Nov 9 10:02:17 EST 2006
Jim Fulton wrote:
>> <adapter
>> for=".myclasses.MyClass"
>> provides=".interfaces.ISomething"
>> factory=".adapters.MyAdapter"
>> />
>
> I think it is a fine idea. That's why it has been supported for
> a long time. You can register adapters and views (which, of course
> are adapters) for classes as well as interfaces.
Hmm, just to be clear:
class A: pass
class B(A): pass
<adapter
for="A"
provides=".interfaces.ISomething"
factory=".adapters.MyAdapter"
/>
x = ISomething(B)
...will work, right?
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the Zope3-dev
mailing list