Commit 24e0a976 authored by Hanno Schlichting's avatar Hanno Schlichting

Deprecate acquiring the request inside Products.ZCatalog's searchResults...

Deprecate acquiring the request inside Products.ZCatalog's searchResults method if no explicit query argument is given.
parent 7dedacfc
...@@ -35,6 +35,9 @@ Bugs Fixed ...@@ -35,6 +35,9 @@ Bugs Fixed
Restructuring Restructuring
+++++++++++++ +++++++++++++
- Deprecate acquiring the request inside Products.ZCatalog's searchResults
method if no explicit query argument is given.
- Cleaned up the Products.ZCatalog search API's. The deprecated support for - Cleaned up the Products.ZCatalog search API's. The deprecated support for
using `<index id>_usage` arguments in the request has been removed. Support using `<index id>_usage` arguments in the request has been removed. Support
for overriding operators via the `<index id>_operator` syntax has been for overriding operators via the `<index id>_operator` syntax has been
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
import types import types
import logging import logging
import warnings
from bisect import bisect from bisect import bisect
from random import randint from random import randint
...@@ -770,7 +771,11 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -770,7 +771,11 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
# The used argument is deprecated and is ignored # The used argument is deprecated and is ignored
if REQUEST is None and not kw: if REQUEST is None and not kw:
# Try to acquire request if we get no args for bw compat # Try to acquire request if we get no args for bw compat
# TODO: Should be deprecated warnings.warn('Calling searchResults without a query argument nor '
'keyword arguments is deprecated. In Zope 2.14 the '
'query will no longer be automatically taken from '
'the acquired request.',
DeprecationWarning, stacklevel=2)
REQUEST = getattr(self, 'REQUEST', None) REQUEST = getattr(self, 'REQUEST', None)
args = CatalogSearchArgumentsMap(REQUEST, kw) args = CatalogSearchArgumentsMap(REQUEST, kw)
sort_index = self._getSortIndex(args) sort_index = self._getSortIndex(args)
......
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