Esempio n. 1
0
 def get_field(self, id, include_disabled=False):
     """Get a field of a certain id
     """
     field = self._getOb(id, None)
     if field is None or not hasattr(aq_base(field), 'is_field'):
         raise AttributeError, "No field %s" % id
     if include_disabled or field.get_value('enabled'):
         return field
     raise FieldDisabledError("Field %s disabled" % id, field)
Esempio n. 2
0
 def get_field(self, id, include_disabled=False):
     """get a field of a certain id."""
     field = self.fields[id]
     if include_disabled or field.get_value('enabled'):
         return field
     raise FieldDisabledError("Field %s is disabled" % id, field)