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


Python PropertyManager.getProperty方法代码示例

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


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

示例1: getProperty

# 需要导入模块: from OFS.PropertyManager import PropertyManager [as 别名]
# 或者: from OFS.PropertyManager.PropertyManager import getProperty [as 别名]
 def getProperty(self, id, d=None):
     """Get property value and apply transformer.  Overrides method in
     Zope's PropertyManager class.  Acquire values from aquisiton parents
     if needed.
     """
     ob = self._findParentWithProperty(id)
     return d if (ob is None) else PropertyManager.getProperty(ob, id, d)
开发者ID:zenoss,项目名称:zenoss-prodbin,代码行数:9,代码来源:ZenPropertyManager.py

示例2: getZProperties

# 需要导入模块: from OFS.PropertyManager import PropertyManager [as 别名]
# 或者: from OFS.PropertyManager.PropertyManager import getProperty [as 别名]
def getZProperties(context):
    """
    Given a context, this function will return all of the ZProperties that
    are defined for this context (ignoring acquisition)
    @returns Dictionary of the form { 'zPropertyName' : 'zPropertyValue',}
    """
    properties = {}
    # make sure we actually have properties
    if not isinstance(context, ZenPropertyManager):
        return properties

    for zprop in filter(iszprop, context.propertyIds()):
        properties[zprop] = PropertyManager.getProperty(context, zprop)
    return properties
开发者ID:bbc,项目名称:zenoss-prodbin,代码行数:16,代码来源:utils.py


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