本文整理汇总了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))
示例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()
示例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))
示例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)
示例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
示例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)
示例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}
示例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()
示例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)
示例10: test_adding
def test_adding(self):
self.portal.invokeFactory(
'Folder',
'doc1'
)
self.assertTrue(IFolder.providedBy(self.portal['doc1']))
示例11: test_adding
def test_adding(self):
self.portal.invokeFactory("Folder", "doc1")
self.assertTrue(IFolder.providedBy(self.portal["doc1"]))