1
This commit is contained in:
parent
19801a09eb
commit
b14354f32a
@ -26,8 +26,9 @@ def is_valid_int(v, **kwargs):
|
||||
|
||||
|
||||
def is_valid_srt(v, **kwargs):
|
||||
if isinstance(v, str):
|
||||
return v
|
||||
try:
|
||||
return str(v)
|
||||
except:
|
||||
return None
|
||||
|
||||
|
||||
@ -39,14 +40,16 @@ def is_valid_float(v, **kwargs):
|
||||
|
||||
|
||||
def is_valid_bool(v, **kwargs):
|
||||
if isinstance(v, bool):
|
||||
return v
|
||||
try:
|
||||
return bool(v)
|
||||
except:
|
||||
return None
|
||||
|
||||
|
||||
def is_valid_array(v, **kwargs):
|
||||
if isinstance(v, list):
|
||||
try:
|
||||
return [str(i) for i in v]
|
||||
except:
|
||||
return None
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user