Commit c9d911de authored by Andreas Jung's avatar Andreas Jung

the object hook/attribute can now return/be a tuple

(similiar to getPhysicalPath())
parent a85837ed
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__ = '$Id: PathIndex.py,v 1.22 2002/04/25 12:44:02 andreasjung Exp $' __version__ = '$Id: PathIndex.py,v 1.23 2002/05/21 17:14:34 andreasjung Exp $'
from Products.PluginIndexes import PluggableIndex from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest from Products.PluginIndexes.common.util import parseIndexRequest
...@@ -99,7 +99,6 @@ class PathIndex(Persistent, Implicit, SimpleItem): ...@@ -99,7 +99,6 @@ class PathIndex(Persistent, Implicit, SimpleItem):
def index_object(self, documentId, obj ,threshold=100): def index_object(self, documentId, obj ,threshold=100):
""" hook for (Z)Catalog """ """ hook for (Z)Catalog """
# first we check if the object provide an attribute or # first we check if the object provide an attribute or
# method to be used as hook for the PathIndex # method to be used as hook for the PathIndex
...@@ -112,9 +111,9 @@ class PathIndex(Persistent, Implicit, SimpleItem): ...@@ -112,9 +111,9 @@ class PathIndex(Persistent, Implicit, SimpleItem):
except: except:
return 0 return 0
if not (isinstance(path,StringType) or
if not isinstance(path,StringType): isinstance(path,TupleType)):
raise TypeError, "attribute/method must be string" raise TypeError, "attribute/method must be/return string or tuple"
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment