Пример #1
0
 def validate(self):
     '''Validate if not a reference property.'''
     if not is_function(self.value):
         if self.type == Schema.STRING:
             self.value = str(self.value)
         DataEntity.validate_datatype(self.type, self.value,
                                      self.entry_schema, self.custom_def)
         self._validate_constraints()
Пример #2
0
 def _is_valid(self, value):
     if is_function(value) or value >= self.constraint_value:
         return True
     return False