Commit 783d0f95 authored by Andreas Jung's avatar Andreas Jung

added warning

fixed typo
parent 6694b792
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
# #
############################################################################## ##############################################################################
__version__ = '$Id: PathIndex.py,v 1.5 2001/08/28 01:05:31 andreasjung Exp $' __version__ = '$Id: PathIndex.py,v 1.6 2001/09/26 14:55:51 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
...@@ -98,7 +98,7 @@ from BTrees.OOBTree import OOBTree,OOSet ...@@ -98,7 +98,7 @@ from BTrees.OOBTree import OOBTree,OOSet
from BTrees.OIBTree import OIBTree from BTrees.OIBTree import OIBTree
from BTrees.IIBTree import IISet,difference,intersection,union from BTrees.IIBTree import IISet,difference,intersection,union
from types import StringType from types import StringType
import re import re,warnings
class PathIndex(PluggableIndex.PluggableIndex, Persistent, class PathIndex(PluggableIndex.PluggableIndex, Persistent,
...@@ -345,6 +345,13 @@ class PathIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -345,6 +345,13 @@ class PathIndex(PluggableIndex.PluggableIndex, Persistent,
record = parseIndexRequest(request,self.id,self.query_options) record = parseIndexRequest(request,self.id,self.query_options)
if record.keys==None: return None if record.keys==None: return None
if request.has_key('%s_level' % cid):
warnings.warn("The usage of the '%s_level' "
"is no longer recommended.\n"
"Please use a mapping object and the "
"'level' key to specify the operator." % cid)
# get the level parameter # get the level parameter
level = record.get("level",0) level = record.get("level",0)
...@@ -368,12 +375,11 @@ class PathIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -368,12 +375,11 @@ class PathIndex(PluggableIndex.PluggableIndex, Persistent,
def uniqueValues(self,name=None,withLength=0): def uniqueValues(self,name=None,withLength=0):
""" need to be consistent with the interface """ """ needed to be consistent with the interface """
return self._index.keys() return self._index.keys()
index_html = DTMLFile('dtml/index', globals()) index_html = DTMLFile('dtml/index', globals())
manage_workspace = DTMLFile('dtml/managePathIndex', globals()) manage_workspace = DTMLFile('dtml/managePathIndex', globals())
......
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