[ZCM] [ZC] 2040/ 2 Comment "Patch to make PathIndex sortable"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Thu Mar 9 07:02:05 EST 2006


Issue #2040 Update (Comment) "Patch to make PathIndex sortable"
 Status Pending, Catalog/feature+solution medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/2040

==============================================================
= Comment - Entry #2 by suvit on Mar 9, 2006 7:01 am

do not forget about the 'items' method, which is needed in some cases by Catalog.sortResults method. SortIndex interface missing 'items' method.

may be 'items' method implementation:

def items(self):
   aq_parent(self).uids.items()

but if PathIndex instance gotten without acquisition, this method will work wrong.

________________________________________
= Request - Entry #1 by nickbower on Mar 6, 2006 8:55 pm


Uploaded:  "PathIndex.patch"
 - http://www.zope.org/Collectors/Zope/2040/PathIndex.patch/view
PathIndex (in PluggableIndexes) is not sortable because it doesn't inherit from the PluggableIndexes/common/UnIndex.py (like FieldIndex etc do).  I can see no obvious reason why it couldn't be sortable hoewver as it still implements inverse lookups using self._unindex which is an IOBTree.

I have produced a patch and attach it here.  Unit tests ran fine and when using it, PathIndex won't barf when you supply the "sort_on" attribute to a catalog search on on this index.

Could this be considered for inclusion into the next zope release?

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



More information about the Zope-Collector-Monitor mailing list