code: def check_value(self, value):
          
          #if self.readonly:
          #    raise error.Error(
          #        "'{field_name}' field is readonly".format(
          #            field_name=self.name))
          if value and self.size:
              if not is_string(value):
                  raise ValueError("Value supplied has to be a string")
              if len(value) > self.size:
                  raise ValueError(
                      "Lenght of the '{0}' is limited to {1}".format(
                          self.name, self.size))
          if not value and self.required:
              raise ValueError("'{0}' field is required".format(self.name))
          return value
docs: Check the validity of a value for the field.