[ZCM] [ZC] 1688/ 1 Request "support mapping interface for extra in addIndex"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Tue Feb 1 07:55:02 EST 2005


Issue #1688 Update (Request) "support mapping interface for extra in addIndex"
 Status Pending, Zope/feature medium
To followup, visit:
  http://collector.zope.org/Zope/1688

==============================================================
= Request - Entry #1 by Anonymous User on Feb 1, 2005 7:55 am

the __init__ in Products/PluginIndexes/common/UnIndex.py should support a dictionary for the extra parameter.

here is a possible patch, which work for me:

        # allow index to index multiple attributes
        if type(extra) is type({}):
            self.indexed_attrs = extra.get('indexed_attrs','').split(',')
            self.indexed_attrs = [ attr.strip() for attr in  self.indexed_attrs if attr ]
            if len(self.indexed_attrs) == 0: self.indexed_attrs = [ self.id ]
        else:
            try: 
                self.indexed_attrs = extra.indexed_attrs.split(',')
                self.indexed_attrs = [ attr.strip() for attr in  self.indexed_attrs if attr ]
                if len(self.indexed_attrs) == 0: self.indexed_attrs = [ self.id ]
            except:
                self.indexed_attrs = [ self.id ] 


==============================================================



More information about the Zope-Collector-Monitor mailing list