Exemplo n.º 1
0
    def validate(self, value, render_path):
        found = 0
        for item in value:
            result = self._find_element_to_render(item)
            if result:
                found += 1

        if not found and not self.is_optional:
            raise ValidationError("Missing choice values", path=render_path)
Exemplo n.º 2
0
 def validate(self, value, render_path):
     for item in value:
         if item is NotSet:
             raise ValidationError("No value set", path=render_path)
Exemplo n.º 3
0
 def validate(self, value, required=False):
     if required and value is None:
         raise ValidationError("Value is required")