Пример #1
0
 def name(self):
     name = self.context.__title__ or self.context.__id__
     if not name:
         name = _(u'Preferences')
     return name
Пример #2
0
 def __set__(self, inst, value):
     field = self._field.bind(inst)
     field.validate(value)
     if field.readonly and hasattr(inst.data, self._name):
         raise ValueError(self._name, _(u"Field is readonly"))
     setattr(inst.data, self._name, value)