本文整理匯總了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