Commit 069dcc63 authored by Hanno Schlichting's avatar Hanno Schlichting

Deprecate mixed dict/keyword argument searchResults calls and using a request object.

parent fee8d6ac
...@@ -452,8 +452,14 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -452,8 +452,14 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
else: else:
real_req = request real_req = request
if real_req is not None: if real_req:
# TODO: This deserves depreaction warnings.warn('You have specified a query using either a request '
'object or a mixture of a query dict and keyword '
'arguments. Please use only a simple query dict. '
'Your query contained "%s". This support is '
'deprecated and will be removed in Zope 2.14.' %
repr(real_req), DeprecationWarning, stacklevel=4)
known_keys = query.keys() known_keys = query.keys()
# The request has too many places where an index restriction # The request has too many places where an index restriction
# might be specified. Putting all of request.form, # might be specified. Putting all of request.form,
......
...@@ -283,7 +283,6 @@ class TestCatalog(CatalogBase, unittest.TestCase): ...@@ -283,7 +283,6 @@ class TestCatalog(CatalogBase, unittest.TestCase):
# getMetadataForRID # getMetadataForRID
# getIndexDataForRID # getIndexDataForRID
# make_query # make_query
# _sorted_search_indexes
def test_sorted_search_indexes_empty(self): def test_sorted_search_indexes_empty(self):
result = self._catalog._sorted_search_indexes({}) result = self._catalog._sorted_search_indexes({})
...@@ -586,8 +585,8 @@ class TestMergeResults(CatalogBase, unittest.TestCase): ...@@ -586,8 +585,8 @@ class TestMergeResults(CatalogBase, unittest.TestCase):
def testLimitSort(self): def testLimitSort(self):
from Products.ZCatalog.Catalog import mergeResults from Products.ZCatalog.Catalog import mergeResults
results = [cat.searchResults( results = [cat.searchResults(
dict(att1='att1', number=True, sort_on='num'), dict(att1='att1', number=True, sort_on='num',
sort_limit=2, _merge=0) sort_limit=2), _merge=0)
for cat in self.catalogs] for cat in self.catalogs]
merged_rids = [r.getRID() for r in mergeResults( merged_rids = [r.getRID() for r in mergeResults(
results, has_sort_keys=True, reverse=False)] results, has_sort_keys=True, reverse=False)]
......
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