當前位置: 首頁>>代碼示例>>Python>>正文


Python ZMIField.get_value方法代碼示例

本文整理匯總了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
開發者ID:poses,項目名稱:erp5,代碼行數:56,代碼來源:ProxyField.py

示例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)
開發者ID:Verde1705,項目名稱:erp5,代碼行數:9,代碼來源:MatrixBox.py

示例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
開發者ID:MarkTang,項目名稱:erp5,代碼行數:10,代碼來源:ParallelListField.py

示例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
開發者ID:smetsjp,項目名稱:erp5,代碼行數:10,代碼來源:CaptchaField.py

示例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
開發者ID:MarkTang,項目名稱:erp5,代碼行數:14,代碼來源:MultiRelationField.py

示例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                                     
開發者ID:jerome-nexedi,項目名稱:erp5,代碼行數:7,代碼來源:CaptchaField.py

示例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)
開發者ID:jerome-nexedi,項目名稱:erp5,代碼行數:6,代碼來源:CaptchaField.py


注:本文中的Products.Formulator.Field.ZMIField.get_value方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。