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


Python Field.ZMIField类代码示例

本文整理汇总了Python中Products.Formulator.Field.ZMIField的典型用法代码示例。如果您正苦于以下问题:Python ZMIField类的具体用法?Python ZMIField怎么用?Python ZMIField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: get_value

  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,代码行数:54,代码来源:ProxyField.py

示例2: _edit

 def _edit(self, result):
     if result.has_key("captcha_type"):
         # Now, find out the old fields and wipe them out !
         new_provider = CaptchaProviderFactory.getProvider(result["captcha_type"])
         old_propertiesIds = self.__extraPropertyList
         new_properties = [x.get_real_field() for x in new_provider.getExtraPropertyList()]
         deleted_properties = [x for x in new_properties if not x.id in old_propertiesIds]
         for deleted_property in deleted_properties:
             if deleted_property.values.has_key("default"):
                 result[deleted_property.id] = deleted_property.values["default"]
             else:
                 result[deleted_property.id] = None
         self.__extraPropertyList = new_properties
     ZMIField._edit(self, result)
开发者ID:smetsjp,项目名称:erp5,代码行数:14,代码来源:CaptchaField.py

示例3: get_value

 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,代码行数:7,代码来源:MatrixBox.py

示例4: paralellListFieldGetValue

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,代码行数:8,代码来源:ParallelListField.py

示例5: getCaptchaCustomTalesPropertyList

 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,代码行数:8,代码来源:CaptchaField.py

示例6: get_orig_value

 def get_orig_value(self, id):
   """
   Get value for id; don't do any override calculation.
   """
   if id in ('is_relation_field', 'is_multi_relation_field'):
     result = 1
   else:
     result = ZMIField.get_orig_value(self, id)
   return result
开发者ID:MarkTang,项目名称:erp5,代码行数:9,代码来源:MultiRelationField.py

示例7: _get_user_input_value

 def _get_user_input_value(self, key, REQUEST):
   """
   Try to get a value of the field from the REQUEST
   """
   proxy_field = self.getTemplateField()
   if proxy_field is not None:
     result = proxy_field._get_user_input_value(key, REQUEST)
   else:
     result = ZMIField._get_user_input_value(self, key, REQUEST)
   return result
开发者ID:poses,项目名称:erp5,代码行数:10,代码来源:ProxyField.py

示例8: get_value

  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,代码行数:12,代码来源:MultiRelationField.py

示例9: has_value

 def has_value(self, id):
     """
 Return true if the field defines such a value.
 """
     result = None
     if (id in self.widget.property_names) or (not self.is_delegated(id)):
         result = ZMIField.has_value(self, id)
     else:
         proxy_field = self.getTemplateField()
         if proxy_field is not None:
             result = proxy_field.has_value(id)
     return result
开发者ID:esosaja,项目名称:erp5,代码行数:12,代码来源:ProxyField.py

示例10: getCaptchaCustomTalesPropertyList

 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,代码行数:5,代码来源:CaptchaField.py

示例11: get_value

 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,代码行数:4,代码来源:CaptchaField.py

示例12: __init__

 def __init__(self, id, **kw):
     ZMIField.__init__(self, id, **kw)
     PythonScript.__init__(self, id)
开发者ID:Provab-Solutions,项目名称:erp5,代码行数:3,代码来源:ZPyChart.py

示例13: get_orig_value

 def get_orig_value(self, id):
   """Get value for id; don't do any override calculation.
   """
   if id not in self.widget.property_names and self.is_delegated(id):
     return self.getTemplateField().get_orig_value(id)
   return ZMIField.get_orig_value(self, id)
开发者ID:poses,项目名称:erp5,代码行数:6,代码来源:ProxyField.py


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