[Zope] Question about adapters

Martijn Jacobs martijn at fourdigits.nl
Fri May 9 05:30:43 EDT 2008


Hello guys.

A question about adapters : I've written two adapters wich implement my 
own interface IMyAdapter. The first adapter adapts 
CMFCore.interfaces._content.IFolderish objects and the other one 
CMFCore.interfaces._content.IContentish objects.

One of the base classes of the IFolderish objects also implement the 
IContentish interface, so when I adapt folderish objects with 
IMyAdapter(object), the adapter registered for the IContentish objects 
always "wins". (and if it's a folderish object I want the adapter for 
IFolderish to jump in).

In other words : How can I influence the order of adapter lookup?

I'm feeling there should be a simple solution for this (applying a 
marker interface to folderish objects?), so I hope someone can point me 
in the right direction.


Kind regards,



Martijn.

-- 
Martijn Jacobs
Four Digits, Internet Solutions

a: Willemsplein 15-1 6811 KB Arnhem NL 
kvk: 091621370000 | btw: 8161.22.234.B01
e-mail: martijn at fourdigits.nl | web: http://www.fourdigits.nl
tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117 



More information about the Zope mailing list