Esempio n. 1
0
 def validate_string(cls, value):
     return (     SimpleModel.validate_string(cls, value)
         and (value is None or (
                 len(value) >= cls.Attributes.min_len
             and len(value) <= cls.Attributes.max_len
             and _re_match_with_span(cls.Attributes, value)
         )))
Esempio n. 2
0
 def validate_string(cls, value):
     return SimpleModel.validate_string(cls, value) and (
         value is None or
         (len(value) <=
          (cls.Attributes.total_digits + cls.Attributes.fraction_digits + 1)
          # + 1 is for decimal separator
          ))
Esempio n. 3
0
 def validate_string(cls, value):
     return SimpleModel.validate_string(cls, value) and (
         value is None or (
             len(value) <= (cls.Attributes.total_digits +
                                          cls.Attributes.fraction_digits + 1)
                                               # + 1 is for decimal separator
         ))
Esempio n. 4
0
 def validate_string(cls, value):
     return (     SimpleModel.validate_string(cls, value)
         and (value is None or (
                 len(value) >= cls.Attributes.min_len
             and len(value) <= cls.Attributes.max_len
             and _re_match_with_span(cls.Attributes, value)
         )))
Esempio n. 5
0
 def validate_string(cls, value):
     return (     SimpleModel.validate_string(cls, value)
         and (value is None or (
                 len(value) >= cls.Attributes.min_len
             and len(value) <= cls.Attributes.max_len
             and (cls.Attributes.pattern is None or
                         re.match(cls.Attributes.pattern, value) is not None)
             )))
Esempio n. 6
0
 def validate_string(cls, value):
     return SimpleModel.validate_string(cls, value) and (
         value is None or (len(value) <= cls.Attributes.max_str_len)
     )
Esempio n. 7
0
 def validate_string(cls, value):
     return SimpleModel.validate_string(cls, value) and value in cls.__values__
Esempio n. 8
0
 def validate_string(cls, value):
     return SimpleModel.validate_string(
         cls, value) and (value is None or
                          (len(value) <= cls.Attributes.max_str_len))
Esempio n. 9
0
File: enum.py Progetto: tunks/spyne
 def validate_string(cls, value):
     return (    SimpleModel.validate_string(cls, value)
             and value in cls.__values__
         )