本文整理汇总了Python中spyne.model._base.SimpleModel类的典型用法代码示例。如果您正苦于以下问题:Python SimpleModel类的具体用法?Python SimpleModel怎么用?Python SimpleModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SimpleModel类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __new__
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: validate_native
def validate_native(cls, value):
return SimpleModel.validate_native(cls, value)
示例3: _validate_string
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)
)))
示例4: is_default
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
)
示例5: validate_native
def validate_native(cls, value):
return (SimpleModel.validate_native(cls, value)
and (value is None or (
re_match_with_span(cls.Attributes, value)
)))
示例6: validate_string
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
)))