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


Python ordered.CMFOrderedBTreeFolderBase類代碼示例

本文整理匯總了Python中plone.folder.ordered.CMFOrderedBTreeFolderBase的典型用法代碼示例。如果您正苦於以下問題:Python CMFOrderedBTreeFolderBase類的具體用法?Python CMFOrderedBTreeFolderBase怎麽用?Python CMFOrderedBTreeFolderBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CMFOrderedBTreeFolderBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, id=None, **kwargs):
        CMFOrderedBTreeFolderBase.__init__(self, id)
        if id is not None:
            self.id = id
        for k, v in kwargs.items():
            setattr(self, k, v)

        # Ensure that the alias gets its own workflow history
        self.workflow_history = PersistentMapping()
開發者ID:Goldmund-Wyldebeast-Wunderliebe,項目名稱:collective.alias,代碼行數:9,代碼來源:content.py

示例2: __init__

    def __init__(self, id=None, **kwargs):
        dublin_kw = {}
        for arg in [ "title", "subject", "description", "contributors",
                     "effective_date", "expiration_date", "format", "language",
                     "rights"]:
            if arg in kwargs:
                dublin_kw[arg] = kwargs.pop(arg)

        CMFOrderedBTreeFolderBase.__init__(self, id)
        DefaultDublinCoreImpl.__init__(self, **dublin_kw)

        for (k,v) in kwargs.items():
            setattr(self, k, v)
開發者ID:numahell,項目名稱:plone.dexterity,代碼行數:13,代碼來源:content.py

示例3: has_key

    def has_key(self, id):
        """Indicates whether the folder has an item by ID.
        """

        if CMFOrderedBTreeFolderBase.has_key(self, id):
            return True
        return id in getSite() and id not in _languagelist and id not in _combinedlanguagelist
開發者ID:khink,項目名稱:plone.app.multilingual,代碼行數:7,代碼來源:lrf.py

示例4: __getattr__

    def __getattr__(self, name):
        try:
            return DexterityContent.__getattr__(self, name)
        except AttributeError:
            pass

        # Be specific about the implementation we use
        return CMFOrderedBTreeFolderBase.__getattr__(self, name)
開發者ID:adam139,項目名稱:plone.dexterity,代碼行數:8,代碼來源:content.py

示例5: __getitem__

    def __getitem__(self, key):

        aliased = getSite()
        try:
            obj = aliased.__getitem__(key)
            new_object = aq_base(obj).__of__(self)
            new_object._v_is_shared_content = True
            return new_object
        except KeyError:
            return CMFOrderedBTreeFolderBase.__getitem__(self, key)
開發者ID:khink,項目名稱:plone.app.multilingual,代碼行數:10,代碼來源:lrf.py

示例6: has_key

 def has_key(self, item_id):
     """Indicates whether the folder has an item by ID.
     """
     return (
         CMFOrderedBTreeFolderBase.has_key(self, item_id)  # noqa
         or (
             item_id in getSite()
             and item_id not in BLACK_LIST_IDS
         )
     )
開發者ID:jianaijun,項目名稱:plone.app.multilingual,代碼行數:10,代碼來源:lrf.py

示例7: _getOb

 def _getOb(self, id, default=_marker):
     if self._aliasTraversal:
         aliased = self._target
         if aliased is not None:
             obj = aliased._getOb(id, default)
             if obj is default:
                 if default is _marker:
                     raise KeyError(id)
                 return default
             return aq_base(obj).__of__(self)
     return CMFOrderedBTreeFolderBase._getOb(self, id, default)
開發者ID:Goldmund-Wyldebeast-Wunderliebe,項目名稱:collective.alias,代碼行數:11,代碼來源:content.py

示例8: __getattr__

 def __getattr__(self, name):
     
     # attribute was not found; try to look it up in the schema and return
     # a default
     
     schema = SCHEMA_CACHE.get(self.portal_type)
     if schema is not None:
         field = schema.get(name, None)
         if field is not None:
             return deepcopy(field.default)
     
     # Be specific about the implementation we use
     return CMFOrderedBTreeFolderBase.__getattr__(self, name)
開發者ID:pingviini,項目名稱:plone.dexterity,代碼行數:13,代碼來源:content.py

示例9: _getOb

    def _getOb(self, item_id, default=_marker):
        obj = CMFOrderedBTreeFolderBase._getOb(self, item_id, default)
        if obj is not default:
            return obj

        aliased = getSite()
        if aliased and item_id not in BLACK_LIST_IDS:
            obj = aliased._getOb(item_id, default)
            if obj is default:
                return default
            new_object = aq_base(obj).__of__(self)
            new_object._v_is_shared_content = True
            return new_object
        if default is not _marker:
            return default
開發者ID:jianaijun,項目名稱:plone.app.multilingual,代碼行數:15,代碼來源:lrf.py

示例10: _getOb

 def _getOb(self, id, default=_marker):
     obj = CMFOrderedBTreeFolderBase._getOb(self, id, default)
     if obj is not default:
         return obj
     else:
         aliased = getSite()
         if aliased:
             if (id not in _languagelist and id not in _combinedlanguagelist):
                 obj = aliased._getOb(id, default)
                 if obj is default:
                     # if default is _marker:
                     #     raise KeyError
                     return default
                 new_object = aq_base(obj).__of__(self)
                 new_object._v_is_shared_content = True
                 return new_object
開發者ID:khink,項目名稱:plone.app.multilingual,代碼行數:16,代碼來源:lrf.py

示例11: objectIds

 def objectIds(self, spec=None, ordered=True):
     # XXX : need to find better aproach
     aliased = getSite()
     aliased_objectIds = set()
     if aliased is not None:
         try:
             # spec = ['Dexterity Container',
             #         'Dexterity Item',
             #         'ATFolder',
             #         'ATDocument']
             aliased_objectIds.update(aliased.objectIds(spec))
             aliased_objectIds -= BLACK_LIST_IDS
         except AttributeError:
             pass
     own_elements = CMFOrderedBTreeFolderBase.objectIds(self, spec, False)
     return [item for item in own_elements] + list(aliased_objectIds)
開發者ID:jianaijun,項目名稱:plone.app.multilingual,代碼行數:16,代碼來源:lrf.py

示例12: objectIds

    def objectIds(self, spec=None, ordered=True):
        aliased = getSite()
        # XXX : need to find better aproach

        try:
            if aliased is not None:
                to_remove = []
                # spec = ['Dexterity Container', 'Dexterity Item', 'ATFolder', 'ATDocument']
                aliased_objectIds = list(aliased.objectIds(spec))
                for id in aliased_objectIds:
                    if id in _languagelist or id in _combinedlanguagelist:
                        aliased_objectIds.remove(id)
            else:
                aliased_objectIds = []

        except AttributeError:
            aliased_objectIds = []

        own_elements = CMFOrderedBTreeFolderBase.objectIds(self, spec, False)
        return [item for item in own_elements] + aliased_objectIds
開發者ID:khink,項目名稱:plone.app.multilingual,代碼行數:20,代碼來源:lrf.py

示例13: __init__

 def __init__(self, id=None, **kwargs):
     CMFOrderedBTreeFolderBase.__init__(self, id)
     DexterityContent.__init__(self, id, **kwargs)
開發者ID:adam139,項目名稱:plone.dexterity,代碼行數:3,代碼來源:content.py

示例14: _checkId

 def _checkId(self, id, allow_dup=0):
     """ check only locally """
     if not allow_dup and id in CMFOrderedBTreeFolderBase.objectIds(self, None, False):
         raise BadRequestException('The id "%s" is invalid--'
                                   'it is already in use.' % id)
開發者ID:khink,項目名稱:plone.app.multilingual,代碼行數:5,代碼來源:lrf.py

示例15: __getitem__

 def __getitem__(self, key):
     if self._aliasTraversal:
         aliased = self._target
         if aliased is not None:
             return aliased.__getitem__(key)
     return CMFOrderedBTreeFolderBase.__getitem__(self, key)
開發者ID:Goldmund-Wyldebeast-Wunderliebe,項目名稱:collective.alias,代碼行數:6,代碼來源:content.py


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