本文整理汇总了Python中Products.ZSQLCatalog.ZSQLCatalog.ZCatalog.countResults方法的典型用法代码示例。如果您正苦于以下问题:Python ZCatalog.countResults方法的具体用法?Python ZCatalog.countResults怎么用?Python ZCatalog.countResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.ZSQLCatalog.ZSQLCatalog.ZCatalog
的用法示例。
在下文中一共展示了ZCatalog.countResults方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: countResults
# 需要导入模块: from Products.ZSQLCatalog.ZSQLCatalog import ZCatalog [as 别名]
# 或者: from Products.ZSQLCatalog.ZSQLCatalog.ZCatalog import countResults [as 别名]
def countResults(self, query=None, **kw):
"""
Calls ZCatalog.countResults with extra arguments that
limit the results to what the user is allowed to see.
"""
# XXX This needs to be set again
#if not _checkPermission(
# Permissions.AccessInactivePortalContent, self):
# base = aq_base(self)
# now = DateTime()
# #kw[ 'effective' ] = { 'query' : now, 'range' : 'max' }
# #kw[ 'expires' ] = { 'query' : now, 'range' : 'min' }
catalog_id = self.getPreferredSQLCatalogId(kw.pop("sql_catalog_id", None))
query = self.getSecurityQuery(query=query, sql_catalog_id=catalog_id, **kw)
kw.setdefault('limit', self.default_count_limit)
# get catalog from preference
return ZCatalog.countResults(self, query=query, sql_catalog_id=catalog_id, **kw)
示例2: unrestrictedCountResults
# 需要导入模块: from Products.ZSQLCatalog.ZSQLCatalog import ZCatalog [as 别名]
# 或者: from Products.ZSQLCatalog.ZSQLCatalog.ZCatalog import countResults [as 别名]
def unrestrictedCountResults(self, REQUEST=None, **kw):
"""Calls ZSQLCatalog.countResults directly without restrictions.
"""
return ZCatalog.countResults(self, REQUEST, **kw)