Re: Registering an indexer for multiple types

Jean Jordaan <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <CAJqnznC-U2HE=U+XjyXEC-8sFawim1Od5oGcmsvfVOJFREuc8g@mail.gmail.com>
On Thu, Oct 23, 2014 at 10:00 AM, Jean Jordaan <[email protected]> wrote:
>
> OK, logged here, while I see if I can figure it out:
>   https://dev.plone.org/ticket/20054

The best I could do was to register a bunch of aliases for the same function:

def _country_indexer(context):
    ...
    return countries

@indexer(IATFile)
def country_indexer_file(context):
    return _country_indexer(context)
...

(for country_indexer_file, country_indexer_document, ...)
with ZCML:

  <adapter name="getCountry" factory=".extender.country_indexer_file" />
  <adapter name="getCountry" factory=".extender.country_indexer_image" />
  <adapter name="getCountry" factory=".extender.country_indexer_project" />

-- 
jean                                              . .. .... //\\\oo///\\

------------------------------------------------------------------------------
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.