Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
069dcc63
Commit
069dcc63
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate mixed dict/keyword argument searchResults calls and using a request object.
parent
fee8d6ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/Products/ZCatalog/Catalog.py
src/Products/ZCatalog/Catalog.py
+8
-2
src/Products/ZCatalog/tests/test_catalog.py
src/Products/ZCatalog/tests/test_catalog.py
+2
-3
No files found.
src/Products/ZCatalog/Catalog.py
View file @
069dcc63
...
@@ -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,
...
...
src/Products/ZCatalog/tests/test_catalog.py
View file @
069dcc63
...
@@ -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
)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment