Пример #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 (cls.Attributes.pattern is None or
                         re.match(cls.Attributes.pattern, value) is not None)
         )
Пример #2
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))
Пример #3
0
 def validate_string(cls, value):
     return (    SimpleModel.validate_string(cls, value)
             and value in cls.__values__
         )
Пример #4
0
Файл: enum.py Проект: rch/rpclib
 def validate_string(cls, value):
     return (    SimpleModel.validate_string(cls, value)
             and value in cls.__values__
         )