예제 #1
0
    def __new__(cls, *args, **kwargs):
        assert len(args) <= 1

        if len(args) == 1:
            kwargs['max_len'] = args[0]

        retval = SimpleModel.__new__(cls,  ** kwargs)

        return retval
예제 #2
0
파일: string.py 프로젝트: plq/spyne
    def __new__(cls, *args, **kwargs):
        assert len(args) <= 1

        if len(args) == 1:
            kwargs['max_len'] = args[0]

        retval = SimpleModel.__new__(cls,  ** kwargs)

        return retval
예제 #3
0
파일: network.py 프로젝트: 1-bit/spyne
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value)
예제 #4
0
파일: network.py 프로젝트: 1-bit/spyne
def _validate_string(cls, value):
    return (     SimpleModel.validate_string(cls, value)
        and (value is None or (
            cls.Attributes.min_len <= len(value) <= cls.Attributes.max_len
            and re_match_with_span(cls.Attributes, value)
        )))
예제 #5
0
파일: string.py 프로젝트: plq/spyne
 def is_default(cls):
     return (    SimpleModel.is_default(cls)
             and cls.Attributes.min_len == Unicode.Attributes.min_len
             and cls.Attributes.max_len == Unicode.Attributes.max_len
             and cls.Attributes.pattern == Unicode.Attributes.pattern
         )
예제 #6
0
파일: string.py 프로젝트: plq/spyne
 def validate_native(cls, value):
     return (SimpleModel.validate_native(cls, value)
         and (value is None or (
             re_match_with_span(cls.Attributes, value)
         )))
예제 #7
0
파일: string.py 프로젝트: plq/spyne
 def validate_string(cls, value):
     return (     SimpleModel.validate_string(cls, value)
         and (value is None or (
             cls.Attributes.min_len <= len(value) <= cls.Attributes.max_len
         )))
예제 #8
0
 def validate_string(cls, value):
     return (     SimpleModel.validate_string(cls, value)
         and (value is None or (
             cls.Attributes.min_len <= len(value) <= cls.Attributes.max_len
         )))
예제 #9
0
 def is_default(cls):
     return (    SimpleModel.is_default(cls)
             and cls.Attributes.min_len == Unicode.Attributes.min_len
             and cls.Attributes.max_len == Unicode.Attributes.max_len
             and cls.Attributes.pattern == Unicode.Attributes.pattern
         )
예제 #10
0
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value)
예제 #11
0
def _uuid_validate_string(cls, value):
    return (     SimpleModel.validate_string(cls, value)
        and (value is None or (
            cls.Attributes.min_len <= len(value) <= cls.Attributes.max_len
            and re_match_with_span(cls.Attributes, value)
        )))
예제 #12
0
 def validate_native(cls, value):
     return (SimpleModel.validate_native(cls, value)
         and (value is None or (
             re_match_with_span(cls.Attributes, value)
         )))