本文整理汇总了Python中Products.Formulator.Field.ZMIField.get_value方法的典型用法代码示例。如果您正苦于以下问题:Python ZMIField.get_value方法的具体用法?Python ZMIField.get_value怎么用?Python ZMIField.get_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.Formulator.Field.ZMIField
的用法示例。
在下文中一共展示了ZMIField.get_value方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_value
# 需要导入模块: from Products.Formulator.Field import ZMIField [as 别名]
# 或者: from Products.Formulator.Field.ZMIField import get_value [as 别名]
def get_value(self, id, **kw):
if id in self.widget.property_names:
return ZMIField.get_value(self, id, **kw)
if not self.is_delegated(id):
original_template_field = self.getRecursiveTemplateField()
function = getOriginalGetValueFunction(original_template_field, id)
if function is not None:
return function(self, id, **kw)
else:
return ZMIField.get_value(self, id, **kw)
field = self
proxy_field = self.getTemplateField()
REQUEST = kw.get('REQUEST', get_request())
if proxy_field is not None and REQUEST is not None:
field = REQUEST.get(
'field__proxyfield_%s_%s_%s' % (self.id, self._p_oid, id),
self)
REQUEST.set(
'field__proxyfield_%s_%s_%s' % (proxy_field.id, proxy_field._p_oid, id),
field)
# Don't use cache if field is not stored in zodb, or if target field is
# defined by a TALES
if self._p_oid is None or self.tales['field_id'] or self.tales['form_id']:
return self._get_value(id, **kw)
# XXX: Are these disabled?
proxy_field = self.getTemplateField(cache=False)
if proxy_field is not None:
return proxy_field.get_value(id, **kw)
else:
return None
cache_id = ('ProxyField.get_value',
self._p_oid,
field._p_oid,
id)
from Products.ERP5Form.Form import field_value_cache
try:
value = field_value_cache[cache_id]
except KeyError:
# either returns non callable value (ex. "Title")
# or a FieldValue instance of appropriate class
value, cacheable = self.getFieldValue(field, id, **kw)
if cacheable:
field_value_cache[cache_id] = value
if value is _USE_ORIGINAL_GET_VALUE_MARKER:
return proxy_field.get_value(id, **kw)
if callable(value):
return value(field, id, **kw)
return value
示例2: get_value
# 需要导入模块: from Products.Formulator.Field import ZMIField [as 别名]
# 或者: from Products.Formulator.Field.ZMIField import get_value [as 别名]
def get_value(self, id, **kw):
if id=='default' and kw.get('render_format') in ('list', ):
return self.widget.render(self, self.generate_field_key(), None,
kw.get('REQUEST'),
render_format=kw.get('render_format'))
else:
return ZMIField.get_value(self, id, **kw)
示例3: paralellListFieldGetValue
# 需要导入模块: from Products.Formulator.Field import ZMIField [as 别名]
# 或者: from Products.Formulator.Field.ZMIField import get_value [as 别名]
def paralellListFieldGetValue(field, id, REQUEST=None, **kw):
result = MARKER
key = KEYWORD % id
if REQUEST is not None and REQUEST.has_key(key):
result = REQUEST.get(key)
if result is MARKER:
result = ZMIField.get_value(field, id, REQUEST=REQUEST, **kw)
return result
示例4: getCaptchaCustomTalesPropertyList
# 需要导入模块: from Products.Formulator.Field import ZMIField [as 别名]
# 或者: from Products.Formulator.Field.ZMIField import get_value [as 别名]
def getCaptchaCustomTalesPropertyList(self):
if hasattr(self, "__extraTalesPropertyList"):
return self.__extraTalesPropertyList
captcha_type = ZMIField.get_value(self, "captcha_type")
captcha_provider = CaptchaProviderFactory.getProvider(captcha_type)
extraPropertyList = captcha_provider.getExtraTalesPropertyList()
self.__extraTalesPropertyList = [x.id for x in extraPropertyList]
return extraPropertyList
示例5: get_value
# 需要导入模块: from Products.Formulator.Field import ZMIField [as 别名]
# 或者: from Products.Formulator.Field.ZMIField import get_value [as 别名]
def get_value(self, id, REQUEST=None, **kw):
"""Get value for id.
Optionally pass keyword arguments that get passed to TALES
expression.
"""
if (id == 'items') and (REQUEST is not None):
# relation_item_list is not editable for the RelationField
result = REQUEST.get('relation_item_list', None)
else:
result = ZMIField.get_value(self, id, REQUEST=REQUEST, **kw)
return result
示例6: getCaptchaCustomTalesPropertyList
# 需要导入模块: from Products.Formulator.Field import ZMIField [as 别名]
# 或者: from Products.Formulator.Field.ZMIField import get_value [as 别名]
def getCaptchaCustomTalesPropertyList(self):
captcha_type = ZMIField.get_value(self, "captcha_type")
captcha_provider = CaptchaProviderFactory.getProvider(captcha_type)
extraPropertyList = captcha_provider.getExtraTalesPropertyList()
return extraPropertyList
示例7: get_value
# 需要导入模块: from Products.Formulator.Field import ZMIField [as 别名]
# 或者: from Products.Formulator.Field.ZMIField import get_value [as 别名]
def get_value(self, id, **kw):
if id in self.getCaptchaCustomPropertyList():
return self.values[id]
return ZMIField.get_value(self, id, **kw)