本文整理汇总了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)
示例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