Esempio n. 1
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
         (value > cls.Attributes.gt and value >= cls.Attributes.ge
          and value < cls.Attributes.lt and value <= cls.Attributes.le))
Esempio n. 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
         ))
Esempio n. 3
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
         ))
Esempio n. 4
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 (
                 value >  cls.Attributes.gt
             and value >= cls.Attributes.ge
             and value <  cls.Attributes.lt
             and value <= cls.Attributes.le
         ))
Esempio n. 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))
Esempio n. 6
0
 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
         ))
Esempio n. 7
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
         ))
Esempio n. 8
0
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value)
Esempio n. 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)
         )))
Esempio n. 10
0
 def validate_native(cls, value):
     return SimpleModel.validate_native(cls, value)
Esempio n. 11
0
 def validate_native(cls, value):
     return (SimpleModel.validate_native(cls, value)
             and (value is None or
                  (_re_match_with_span(cls.Attributes, value))))