Commit dd85f6e0 authored by Aurel's avatar Aurel

countResults must defined its result's limit to 1 by default


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20107 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 104473c9
...@@ -193,6 +193,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -193,6 +193,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
security = ClassSecurityInfo() security = ClassSecurityInfo()
default_result_limit = 1000 default_result_limit = 1000
default_count_limit = 1
manage_options = ({ 'label' : 'Overview', 'action' : 'manage_overview' }, manage_options = ({ 'label' : 'Overview', 'action' : 'manage_overview' },
) + ZCatalog.manage_options ) + ZCatalog.manage_options
...@@ -685,7 +686,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -685,7 +686,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
# #kw[ 'expires' ] = { 'query' : now, 'range' : 'min' } # #kw[ 'expires' ] = { 'query' : now, 'range' : 'min' }
catalog_id = self.getPreferredSQLCatalogId(kw.pop("sql_catalog_id", None)) catalog_id = self.getPreferredSQLCatalogId(kw.pop("sql_catalog_id", None))
query = self.getSecurityQuery(query=query, sql_catalog_id=catalog_id, **kw) query = self.getSecurityQuery(query=query, sql_catalog_id=catalog_id, **kw)
kw.setdefault('limit', self.default_result_limit) kw.setdefault('limit', self.default_count_limit)
# get catalog from preference # get catalog from preference
return ZCatalog.countResults(self, query=query, sql_catalog_id=catalog_id, **kw) return ZCatalog.countResults(self, query=query, sql_catalog_id=catalog_id, **kw)
......
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