本文整理汇总了Python中plone.folder.interfaces.IExplicitOrdering.providedBy方法的典型用法代码示例。如果您正苦于以下问题:Python IExplicitOrdering.providedBy方法的具体用法?Python IExplicitOrdering.providedBy怎么用?Python IExplicitOrdering.providedBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.folder.interfaces.IExplicitOrdering
的用法示例。
在下文中一共展示了IExplicitOrdering.providedBy方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: moveObjectsToBottom
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def moveObjectsToBottom(self, ids, subset_ids=None):
""" Move specified sub-objects to bottom of container. """
ordering = self.getOrdering()
if IExplicitOrdering.providedBy(ordering):
return ordering.moveObjectsToBottom(ids, subset_ids)
else:
return 0
示例2: orderObjects
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def orderObjects(self, key, reverse=None):
""" Order sub-objects by key and direction. """
ordering = self.getOrdering()
if IExplicitOrdering.providedBy(ordering):
return ordering.orderObjects(key, reverse)
else:
return 0
示例3: moveObjectToPosition
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def moveObjectToPosition(self, id, position, suppress_events=False):
""" Move specified object to absolute position. """
ordering = self.getOrdering()
if IExplicitOrdering.providedBy(ordering):
return ordering.moveObjectToPosition(id, position, suppress_events)
else:
return 0
示例4: orderable
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def orderable(self):
if _is_collection(self.context):
return False
if IPloneSiteRoot.providedBy(self.context):
return True
ordering = self.context.getOrdering()
return IExplicitOrdering.providedBy(ordering)
示例5: moveObjectsDown
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def moveObjectsDown(self, ids, delta=1, subset_ids=None):
""" Move specified sub-objects down by delta in container. """
ordering = self.getOrdering()
if IExplicitOrdering.providedBy(ordering):
return ordering.moveObjectsDown(ids, delta, subset_ids)
else:
return 0
示例6: _supports_explicit_ordering
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def _supports_explicit_ordering(context):
if IPloneSiteRoot.providedBy(context):
return True
if not IOrderableFolder.providedBy(context):
return False
ordering = context.getOrdering()
return IExplicitOrdering.providedBy(ordering)
示例7: __call__
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def __call__(self, item_id, delta, subset_ids=None):
context = aq_inner(self.context)
try:
if not IOrderableFolder.providedBy(context):
if not base_hasattr(context, 'moveObjectsByDelta'):
# for instance, plone site root does not use plone.folder
raise ValueError("Not an ordered folder.")
else:
ordering = context.getOrdering()
if not IExplicitOrdering.providedBy(ordering):
raise ValueError("Ordering disable on folder.")
delta = int(delta)
if subset_ids is not None:
objectPos = self.context.getObjectPosition
position_id = [(objectPos(id), id) for id in subset_ids]
position_id.sort()
if subset_ids != [id for position, id in position_id]:
raise ValueError("Client/server ordering mismatch.")
self.context.moveObjectsByDelta(item_id, delta, subset_ids)
except ValueError as e:
self.context.REQUEST.response.setStatus('BadRequest')
return str(e)
ploneUtils = getToolByName(self.context, 'plone_utils')
ploneUtils.reindexOnReorder(self.context)
return "<done />"
示例8: getOrdering
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def getOrdering(self):
if IPloneSiteRoot.providedBy(self.context):
return self.context
ordering = self.context.getOrdering()
if not IExplicitOrdering.providedBy(ordering):
return None
return ordering
示例9: getOrdering
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def getOrdering(context):
if IPloneSiteRoot.providedBy(context):
return context
else:
ordering = context.getOrdering()
if not IExplicitOrdering.providedBy(ordering):
return None
return ordering
示例10: moveObjectsByDelta
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def moveObjectsByDelta(self, ids, delta, subset_ids=None,
suppress_events=False):
""" Move specified sub-objects by delta. """
ordering = self.getOrdering()
if IExplicitOrdering.providedBy(ordering):
return ordering.moveObjectsByDelta(ids, delta, subset_ids,
suppress_events)
else:
return 0
示例11: orderable
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def orderable(self):
"""
"""
context = aq_inner(self.context)
if not IOrderableFolder.providedBy(context):
if hasattr(context, 'moveObjectsByDelta'):
# for instance, plone site root does not use plone.folder
return True
else:
return False
ordering = context.getOrdering()
return IExplicitOrdering.providedBy(ordering)
示例12: getOrdering
# 需要导入模块: from plone.folder.interfaces import IExplicitOrdering [as 别名]
# 或者: from plone.folder.interfaces.IExplicitOrdering import providedBy [as 别名]
def getOrdering(self):
if IPloneSiteRoot.providedBy(self.context):
return self.context
try:
ordering = self.context.aq_base.getOrdering()
except AttributeError:
if IOrderedContainer.providedBy(self.context):
# Archetype
return IOrderedContainer(self.context)
return None
if not IExplicitOrdering.providedBy(ordering):
return None
return ordering