当前位置: 首页>>代码示例>>Python>>正文


Python IOrderedContainer.getObjectPosition方法代码示例

本文整理汇总了Python中OFS.interfaces.IOrderedContainer.getObjectPosition方法的典型用法代码示例。如果您正苦于以下问题:Python IOrderedContainer.getObjectPosition方法的具体用法?Python IOrderedContainer.getObjectPosition怎么用?Python IOrderedContainer.getObjectPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OFS.interfaces.IOrderedContainer的用法示例。


在下文中一共展示了IOrderedContainer.getObjectPosition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_position_in_parent

# 需要导入模块: from OFS.interfaces import IOrderedContainer [as 别名]
# 或者: from OFS.interfaces.IOrderedContainer import getObjectPosition [as 别名]
 def _get_position_in_parent(obj):
     # Use IOrderedContainer interface to extract the object's manual ordering position
     parent = obj.aq_inner.aq_parent
     ordered = IOrderedContainer(parent, None)
     if ordered is not None:
         return ordered.getObjectPosition(obj.getId())
     return 0
开发者ID:oikoumene,项目名称:startupworks.pjp,代码行数:9,代码来源:utils.py

示例2: getObjPositionInParent

# 需要导入模块: from OFS.interfaces import IOrderedContainer [as 别名]
# 或者: from OFS.interfaces.IOrderedContainer import getObjectPosition [as 别名]
def getObjPositionInParent(obj):
    """ Helper method for catalog based folder contents.
    """
    parent = aq_parent(aq_inner(obj))
    ordered = IOrderedContainer(parent, None)
    if ordered is not None:
        return ordered.getObjectPosition(obj.getId())
    return 0
开发者ID:erral,项目名称:Products.CMFPlone,代码行数:10,代码来源:CatalogTool.py

示例3: _getPositionInParent

# 需要导入模块: from OFS.interfaces import IOrderedContainer [as 别名]
# 或者: from OFS.interfaces.IOrderedContainer import getObjectPosition [as 别名]
def _getPositionInParent(obj):

    parent = aq_parent(aq_inner(obj))
    ordered = IOrderedContainer(parent, None)
    if ordered is not None:
        pos = ordered.getObjectPosition(obj.getId())
    else:
        pos = 0
    return pos
开发者ID:zopyx,项目名称:zopyx.plone.migration,代码行数:11,代码来源:exporter.py

示例4: getObjPositionInParent

# 需要导入模块: from OFS.interfaces import IOrderedContainer [as 别名]
# 或者: from OFS.interfaces.IOrderedContainer import getObjectPosition [as 别名]
def getObjPositionInParent(obj):
    """ Helper method for catalog based folder contents.

    >>> from Products.CMFPlone.CatalogTool import getObjPositionInParent

    >>> getObjPositionInParent(self.folder)
    0
    """
    parent = aq_parent(aq_inner(obj))
    ordered = IOrderedContainer(parent, None)
    if ordered is not None:
        return ordered.getObjectPosition(obj.getId())
    return 0
开发者ID:nacho22martin,项目名称:tesis,代码行数:15,代码来源:CatalogTool.py

示例5: __call__

# 需要导入模块: from OFS.interfaces import IOrderedContainer [as 别名]
# 或者: from OFS.interfaces.IOrderedContainer import getObjectPosition [as 别名]
    def __call__(self, config):
        parent = aq_parent(aq_inner(self.context))
        klass = self.context.__class__

        owner = self.context.getOwner()

        data = {'_classname': klass.__name__,
                '_class': klass.__module__ + '.' + klass.__name__,
                '_id': self.context.getId(),
                '_owner': owner and owner.getId(),
                '_path': '/'.join(self.context.getPhysicalPath()),
                '_type': self.context.portal_type}

        ordered_parent = IOrderedContainer(parent, None)
        if ordered_parent:
            data['_obj_position_in_parent'] = ordered_parent.getObjectPosition(
                self.context.getId())

        return data
开发者ID:4teamwork,项目名称:ftw.jsondump,代码行数:21,代码来源:metadata.py

示例6: get_position_in_parent

# 需要导入模块: from OFS.interfaces import IOrderedContainer [as 别名]
# 或者: from OFS.interfaces.IOrderedContainer import getObjectPosition [as 别名]
def get_position_in_parent(obj):
    parent = obj.aq_inner.aq_parent
    ordered = IOrderedContainer(parent, None)
    if ordered is not None:
        return ordered.getObjectPosition(obj.getId())
    return 0
开发者ID:affinitic,项目名称:fbk.policy,代码行数:8,代码来源:itemlisting.py


注:本文中的OFS.interfaces.IOrderedContainer.getObjectPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。