Commit 8c34b8f8 authored by Andreas Jung's avatar Andreas Jung

     - Using "_usage" parameters in a ZCatalog query is deprecated and
       logged as DeprecationWarning.
parent a60814b3
......@@ -50,13 +50,13 @@ class DI_Tests(unittest.TestCase):
self._index = DateIndex('date')
self._noop_req = {'bar': 123}
self._request = {'date': DateTime(0)}
self._min_req = {'date': DateTime('2032-05-08 15:16:17'),
'date_usage': 'range:min'}
self._max_req = {'date': DateTime('2032-05-08 15:16:17'),
'date_usage': 'range:max'}
self._range_req = {'date': (DateTime('2002-05-08 15:16:17'),
self._min_req = {'date': {'query': DateTime('2032-05-08 15:16:17'),
'range': 'min'}}
self._max_req = {'date': {'query': DateTime('2032-05-08 15:16:17'),
'range': 'max'}}
self._range_req = {'date': {'query':(DateTime('2002-05-08 15:16:17'),
DateTime('2062-05-08 15:16:17')),
'date_usage': 'range:min:max'}
'range': 'min:max'}}
self._zero_req = {'date': 0}
self._none_req = {'date': None}
self._float_req = {'date': 1072742620.0}
......
......@@ -57,14 +57,14 @@ class TestCase( unittest.TestCase ):
self._noop_req = { 'bar': 123 }
self._request = { 'foo': 'abce' }
self._min_req = { 'foo': 'abc'
, 'foo_usage': 'range:min'
self._min_req = { 'foo': {'query': 'abc'
, 'range': 'min'}
}
self._max_req = { 'foo': 'abc'
, 'foo_usage': 'range:max'
self._max_req = { 'foo': {'query': 'abc'
, 'range': 'max' }
}
self._range_req = { 'foo': ( 'abc', 'abcd' )
, 'foo_usage': 'range:min:max'
self._range_req = { 'foo': {'query': ( 'abc', 'abcd' )
, 'range': 'min:max' }
}
self._zero_req = { 'foo': 0 }
self._none_req = { 'foo': None }
......
......@@ -11,10 +11,11 @@
#
#############################################################################
__version__ = '$Id: util.py,v 1.11 2003/09/29 12:00:17 andreasjung Exp $'
__version__ = '$Id: util.py,v 1.12 2004/01/07 16:44:30 andreasjung Exp $'
import re
from warnings import warn
from types import StringType,ListType,TupleType,DictType,InstanceType
from DateTime import DateTime
......@@ -65,7 +66,6 @@ class parseIndexRequest:
"""
self.id = iid
if not request.has_key(iid):
self.keys = None
return
......@@ -74,6 +74,7 @@ class parseIndexRequest:
usage_param = iid + '_usage'
if request.has_key(usage_param):
self.usage = request[usage_param]
warn("\nZCatalog query using '%s' detected.\nUsing query parameters ending with '_usage' is deprecated.\nConsider using record-style parameters instead (see lib/python/Products/PluggableIndexes/README.txt for details)" % usage_param, DeprecationWarning)
param = request[iid]
keys = None
......
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