예제 #1
0
파일: primitive.py 프로젝트: tunks/spyne
 def validate_native(cls, value):
     if isinstance(value, datetime.datetime) and value.tzinfo is None:
         value = value.replace(tzinfo=spyne.LOCAL_TZ)
     return SimpleModel.validate_native(cls, value) and (
         value is None or
         (value > cls.Attributes.gt and value >= cls.Attributes.ge
          and value < cls.Attributes.lt and value <= cls.Attributes.le))
예제 #2
0
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value) and (
         value is None or (
             value >  cls.Attributes.gt and
             value >= cls.Attributes.ge and
             value <  cls.Attributes.lt and
             value <= cls.Attributes.le
         ))
예제 #3
0
파일: primitive.py 프로젝트: trecouvr/spyne
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value) and (
         value is None or (
                 value >  cls.Attributes.gt
             and value >= cls.Attributes.ge
             and value <  cls.Attributes.lt
             and value <= cls.Attributes.le
         ))
예제 #4
0
파일: primitive.py 프로젝트: jrocnuck/spyne
 def validate_native(cls, value):
     if isinstance(value, datetime.datetime) and value.tzinfo is None:
         value = value.replace(tzinfo=spyne.LOCAL_TZ)
     return SimpleModel.validate_native(cls, value) and (
         value is None or (
                 value >  cls.Attributes.gt
             and value >= cls.Attributes.ge
             and value <  cls.Attributes.lt
             and value <= cls.Attributes.le
         ))
예제 #5
0
 def validate_native(cls, value):
     if isinstance(value, datetime.datetime) and value.tzinfo is None:
         value = value.replace(tzinfo=spyne.LOCAL_TZ)
     return SimpleModel.validate_native(cls, value) and (value is None or (
         # min_dt is also a valid value if gt is intact.
         (cls.Attributes.gt is None or value > cls.Attributes.gt)
         and value >= cls.Attributes.ge
         # max_dt is also a valid value if lt is intact.
         and (cls.Attributes.lt is None
              or value < cls.Attributes.lt) and value <= cls.Attributes.le))
예제 #6
0
파일: primitive.py 프로젝트: esauro/spyne
 def validate_native(cls, value):
     if value is not None and isinstance(value, datetime.datetime):
         value = value.replace(tzinfo=pytz.utc)
     return SimpleModel.validate_native(cls, value) and (
         value is None or (
             value >  cls.Attributes.gt and
             value >= cls.Attributes.ge and
             value <  cls.Attributes.lt and
             value <= cls.Attributes.le
         ))
예제 #7
0
파일: datetime.py 프로젝트: plq/spyne
 def validate_native(cls, value):
     if isinstance(value, datetime.datetime) and value.tzinfo is None:
         value = value.replace(tzinfo=spyne.LOCAL_TZ)
     return SimpleModel.validate_native(cls, value) and (
         value is None or (
             # min_dt is also a valid value if gt is intact.
                 (cls.Attributes.gt is None or value > cls.Attributes.gt)
             and value >= cls.Attributes.ge
             # max_dt is also a valid value if lt is intact.
             and (cls.Attributes.lt is None or value < cls.Attributes.lt)
             and value <= cls.Attributes.le
         ))
예제 #8
0
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value)
예제 #9
0
 def validate_native(cls, value):
     return (SimpleModel.validate_native(cls, value)
         and (value is None or (
             _re_match_with_span(cls.Attributes, value)
         )))
예제 #10
0
파일: primitive.py 프로젝트: iceteahh/spyne
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value)
예제 #11
0
파일: primitive.py 프로젝트: iceteahh/spyne
 def validate_native(cls, value):
     return (SimpleModel.validate_native(cls, value)
             and (value is None or
                  (_re_match_with_span(cls.Attributes, value))))