当前位置: 首页>>代码示例>>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;未经允许,请勿转载。