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):
else:
real_req = request
if real_req is not None:
# TODO: This deserves depreaction
if real_req:
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()
# The request has too many places where an index restriction
# might be specified. Putting all of request.form,
......
......@@ -283,7 +283,6 @@ class TestCatalog(CatalogBase, unittest.TestCase):
# getMetadataForRID
# getIndexDataForRID
# make_query
# _sorted_search_indexes
def test_sorted_search_indexes_empty(self):
result = self._catalog._sorted_search_indexes({})
......@@ -586,8 +585,8 @@ class TestMergeResults(CatalogBase, unittest.TestCase):
def testLimitSort(self):
from Products.ZCatalog.Catalog import mergeResults
results = [cat.searchResults(
dict(att1='att1', number=True, sort_on='num'),
sort_limit=2, _merge=0)
dict(att1='att1', number=True, sort_on='num',
sort_limit=2), _merge=0)
for cat in self.catalogs]
merged_rids = [r.getRID() for r in mergeResults(
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