Re: Registering an indexer for multiple types

Alec Mitchell <apm13-WLbs8XpHrcb2fBVCVOL8/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <CAMW6WS=bygX35kt5ZCOAkieK25Kyz=OYCvafvjM2jQaV2G8yMw@mail.gmail.com>
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.  You should be
able to simplify a bit though:

in python:

@indexer(IATDocument)
def country_indexer(context):
    return _country_indexer(context)

in zcml:

<adapter name="getCountry" factory=".extender.country_indexer" />
<adapter name="getCountry" factory=".extender.country_indexer"
 for="Products.ATContentType.interfaces. IATFile" />
…



On Wed, Oct 22, 2014 at 7:00 PM, Jean Jordaan <[email protected]>
wrote:

> On Thu, Oct 23, 2014 at 5:45 AM, Jens W. Klein <jens-/[email protected]>
> wrote:
> >
> > i'd consider that as conceptional a bug with the decorator.
>
> OK, logged here, while I see if I can figure it out:
>   https://dev.plone.org/ticket/20054
>
> (Is that still the place to log Plone bugs? There's no tracker on
> https://github.com/plone/plone.indexer )
>
> --
> jean                                              . .. .... //\\\oo///\\
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Plone-developers mailing list
> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/plone-developers
>

------------------------------------------------------------------------------

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.