本文整理匯總了Python中plone.folder.interfaces.IExplicitOrdering.orderObjects方法的典型用法代碼示例。如果您正苦於以下問題:Python IExplicitOrdering.orderObjects方法的具體用法?Python IExplicitOrdering.orderObjects怎麽用?Python IExplicitOrdering.orderObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類plone.folder.interfaces.IExplicitOrdering
的用法示例。
在下文中一共展示了IExplicitOrdering.orderObjects方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testReorderThenCopyTemplateKeepsOrder
# 需要導入模塊: from plone.folder.interfaces import IExplicitOrdering [as 別名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import orderObjects [as 別名]
def testReorderThenCopyTemplateKeepsOrder(self):
from Acquisition import aq_parent
from plone.folder.interfaces import IExplicitOrdering
from euphorie.content.surveygroup import AddForm
original_order = [u"one", u"two", u"three", u"four", u"five", u"six",
u"seven", u"eight", u"nine", u"ten"]
sorted_order = list(sorted(original_order))
self.loginAsPortalOwner()
module = self.createModule()
for title in original_order:
self._create(module, "euphorie.risk", title, title=title)
self.assertEqual([r.title for r in module.values()], original_order)
ordering = IExplicitOrdering(module)
ordering.orderObjects("title")
self.assertEqual([r.title for r in module.values()], sorted_order)
request = module.REQUEST
survey = aq_parent(module)
container = self.portal.sectors.nl.sector
target = self._create(container, "euphorie.surveygroup", "target")
copy = AddForm(container, request).copyTemplate(survey, target)
self.assertEqual(
[r.title for r in copy["module"].values()], sorted_order)