本文整理汇总了Python中plone.app.contenttypes.behaviors.collection.ICollection.customViewFields方法的典型用法代码示例。如果您正苦于以下问题:Python ICollection.customViewFields方法的具体用法?Python ICollection.customViewFields怎么用?Python ICollection.customViewFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.app.contenttypes.behaviors.collection.ICollection
的用法示例。
在下文中一共展示了ICollection.customViewFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: migrate_schema_fields
# 需要导入模块: from plone.app.contenttypes.behaviors.collection import ICollection [as 别名]
# 或者: from plone.app.contenttypes.behaviors.collection.ICollection import customViewFields [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 customViewFields [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