本文整理匯總了Python中plone.app.contenttypes.behaviors.collection.ICollection.limit方法的典型用法代碼示例。如果您正苦於以下問題:Python ICollection.limit方法的具體用法?Python ICollection.limit怎麽用?Python ICollection.limit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類plone.app.contenttypes.behaviors.collection.ICollection
的用法示例。
在下文中一共展示了ICollection.limit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: migrate_schema_fields
# 需要導入模塊: from plone.app.contenttypes.behaviors.collection import ICollection [as 別名]
# 或者: from plone.app.contenttypes.behaviors.collection.ICollection import limit [as 別名]
def migrate_schema_fields(self):
# migrate the richtext
super(CollectionMigrator, self).migrate_schema_fields()
# migrate the rest of the schema into the behavior
wrapped = ICollection(self.new)
wrapped.query = self.old.query
wrapped.sort_on = self.old.sort_on
wrapped.sort_reversed = self.old.sort_reversed
wrapped.limit = self.old.limit
wrapped.customViewFields = self.old.customViewFields
示例2: migrate_criteria
# 需要導入模塊: from plone.app.contenttypes.behaviors.collection import ICollection [as 別名]
# 或者: from plone.app.contenttypes.behaviors.collection.ICollection import limit [as 別名]
def migrate_criteria(self):
"""Migrate old style to new style criteria.
Plus handling for some special fields.
"""
# The old Topic has boolean limitNumber and integer itemCount,
# where the new Collection only has limit.
adapted = ICollection(self.new)
if self.old.getLimitNumber():
adapted.limit = self.old.getItemCount()
adapted.customViewFields = self.old.getCustomViewFields()
# Get the old data stored by the beforeChange_criteria method.
if self._collection_sort_reversed is not None:
adapted.sort_reversed = self._collection_sort_reversed
if self._collection_sort_on is not None:
adapted.sort_on = self._collection_sort_on
if self._collection_query is not None:
adapted.query = self._collection_query