[ZCM] [ZC] 1688/ 2 Assign "support mapping interface for extra in addIndex"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Tue Feb 1 09:28:12 EST 2005


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

==============================================================
= Assign - Entry #2 by tino on Feb 1, 2005 9:28 am

 Status: Pending => Accepted

 Supporters added: tino

I'll refine the patch and put this in
________________________________________
= 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