|
From: Jean J. <jea...@gm...> - 2014-10-24 02:04:54
|
On Thu, Oct 23, 2014 at 10:27 PM, Alec Mitchell <ap...@co...> wrote: > I don't think this is a bug per se, nor is it likely easily fixable. Note > that actual adapter registration is done in zcml, the decorator simply wraps > the function and add a _default_ context interface for the adapter. To get > adapters registered for different interfaces you will always need to perform > multiple zcml (or grok) registrations, performing multiple function > wrappings is neither useful nor necessary for this purpose. When you explain it that way, it makes sense, but from my perspective as a user I have zero concern with the fact that multiple function wrappings are happening. My goal isn't wrapping functions. It's the right way to say "index all these types with this function". I found a way, but it feels so wrong :-p I experimented with making the decorator use the un-wrapped function, when it gets called the second and subsequent times, but failed. Maybe it could make a copy of the function? My component-fu is too weak. > You should be able to simplify a bit though: ... > <adapter name="getCountry" factory=".extender.country_indexer" > for="Products.ATContentType.interfaces. IATFile" /> If I do this, I don't see the indexer being called for the interfaces specified by the `for="..."` attribute. Only for the `@indexer()`-specified interface. -- jean . .. .... //\\\oo///\\ |