當前位置: 首頁>>代碼示例>>Python>>正文


Python ICollection.customViewFields方法代碼示例

本文整理匯總了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
開發者ID:naro,項目名稱:plone.app.contenttypes,代碼行數:13,代碼來源:migration.py

示例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
開發者ID:jianaijun,項目名稱:plone.app.contenttypes,代碼行數:21,代碼來源:topics.py


注:本文中的plone.app.contenttypes.behaviors.collection.ICollection.customViewFields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。