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


Python interfaces.IFolder類代碼示例

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


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

示例1: test_fix_interface_for_folder

    def test_fix_interface_for_folder(self):
        self.obj.portal_type = 'Folder'
        self.catalog.reindexObject(self.obj)

        self.portal.restrictedTraverse('fix_base_classes')()

        self.assertTrue(IFolder.providedBy(self.obj))
開發者ID:enfold,項目名稱:plone.app.contenttypes,代碼行數:7,代碼來源:test_migration_browser.py

示例2: search_base

 def search_base(self, context=None):
     if not context:
         context = self.context
     if not IFolder.providedBy(context):
         return self.search_base(context=context.aq_parent)
     else:
         return context.absolute_url()
開發者ID:esoth,項目名稱:esoth.media,代碼行數:7,代碼來源:album.py

示例3: test_factory

 def test_factory(self):
     fti = queryUtility(
         IDexterityFTI,
         name='Folder'
     )
     factory = fti.factory
     new_object = createObject(factory)
     self.assertTrue(IFolder.providedBy(new_object))
開發者ID:enfold,項目名稱:plone.app.contenttypes,代碼行數:8,代碼來源:test_folder.py

示例4: test_folder_is_migrated

 def test_folder_is_migrated(self):
     from Products.ATContentTypes.content.folder import ATFolder
     from plone.app.contenttypes.migration.migration import FolderMigrator
     from plone.app.contenttypes.interfaces import IFolder
     at_folder = self.createATCTobject(ATFolder, 'folder')
     migrator = self.get_migrator(at_folder, FolderMigrator)
     migrator.migrate()
     new_folder = self.portal['folder']
     self.assertTrue(IFolder.providedBy(new_folder))
     self.assertTrue(at_folder is not new_folder)
開發者ID:mingtak,項目名稱:prome,代碼行數:10,代碼來源:test_migration.py

示例5: getTargetFolder

 def getTargetFolder(self):
     target_folder = getattr(self.calendar, 'target_folder', None)
     if target_folder:
         addContext = self.portal.unrestrictedTraverse('/' + self.portal.id \
                                                       + target_folder)
     elif IFolder.providedBy(self.context):
         addContext = self.context
     else:
         addContext = aq_parent(aq_inner(self.context))
     return addContext
開發者ID:RedTurtle,項目名稱:Solgema.fullcalendar,代碼行數:10,代碼來源:adapters.py

示例6: test_folder_is_migrated

 def test_folder_is_migrated(self):
     from plone.app.contenttypes.migration.migration import FolderMigrator
     from plone.app.contenttypes.interfaces import IFolder
     self.portal.invokeFactory('Folder', 'folder')
     at_folder = self.portal['folder']
     applyProfile(self.portal, 'plone.app.contenttypes:default')
     migrator = self.get_migrator(at_folder, FolderMigrator)
     migrator.migrate()
     dx_folder = self.portal['folder']
     self.assertTrue(IFolder.providedBy(dx_folder))
     self.assertTrue(at_folder is not dx_folder)
開發者ID:martior,項目名稱:plone.app.contenttypes,代碼行數:11,代碼來源:test_migration.py

示例7: _album_results

 def _album_results(self):
     """Get results to display an album with subalbums.
     """
     results = self.results()
     images = []
     folders = []
     for it in results:
         # TODO: potentially expensive!
         ob = it.getObject()
         if IImage.providedBy(ob):
             images.append(it)
         elif IFolder.providedBy(ob):
             folders.append(it)
     return {'images': images, 'folders': folders}
開發者ID:Blaastolen,項目名稱:plone.app.contenttypes,代碼行數:14,代碼來源:collection.py

示例8: __call__

 def __call__(self):
     if IFolder.providedBy(self.context):
         self.folder = self.context
         self.text = self.context.Description()
     else:
         self.folder = aq_parent(self.context)
         value = getattr(self.context, 'text', None)
         if value:
             if IRichTextValue.providedBy(value):
                 self.text = value.output
             else:
                 self.text = value
         else:
             self.text = self.context.Description()
     return self.index()
開發者ID:EU-OSHA,項目名稱:osha.hwccontent,代碼行數:15,代碼來源:section.py

示例9: test_folders_in_root_are_plone_default_ordering

    def test_folders_in_root_are_plone_default_ordering(self):
        """
        Após a ordenação de pastas no upgradeStep 10600 complementando o 5000,
        para que todos os diretórios do root tenham a ordenação default do
        Plone, é preciso garantir esse comportamento em todos os diretórios.

        Esse teste hoje não retorna nada, é para garantir que, caso no futuro

        self.applyProfile(portal, 'brasil.gov.portal:initcontent')

        por exemplo seja utilizado em testing.py e que algum diretório criado
        na raiz dessa forma não tenha a ordenação padrão.
        """
        all_ordered = all([
            isinstance(self.portal[pasta_id].getOrdering(), DefaultOrdering)
            for pasta_id in self.portal.objectIds()
            if IFolder.providedBy(self.portal[pasta_id])
        ])
        self.assertTrue(all_ordered)
開發者ID:brunobbbs,項目名稱:brasil.gov.portal,代碼行數:19,代碼來源:test_init_content.py

示例10: test_adding

 def test_adding(self):
     self.portal.invokeFactory(
         'Folder',
         'doc1'
     )
     self.assertTrue(IFolder.providedBy(self.portal['doc1']))
開發者ID:enfold,項目名稱:plone.app.contenttypes,代碼行數:6,代碼來源:test_folder.py

示例11: test_adding

 def test_adding(self):
     self.portal.invokeFactory("Folder", "doc1")
     self.assertTrue(IFolder.providedBy(self.portal["doc1"]))
開發者ID:naro,項目名稱:plone.app.contenttypes,代碼行數:3,代碼來源:test_folder.py


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