兼容bool None

This commit is contained in:
wuaho 2021-07-14 19:11:31 +08:00
parent 8b8a2768c9
commit 23e113c02f

View File

@ -28,6 +28,9 @@ def restore_field(data: dict) -> tuple:
elif isinstance(v, bool): elif isinstance(v, bool):
sign_kv[key] = str(v).lower() sign_kv[key] = str(v).lower()
res[key] = int(v) res[key] = int(v)
elif v is None:
sign_kv[key] = 'null'
res[key] = ''
else: else:
sign_kv[key] = v sign_kv[key] = v
return res, sign_kv return res, sign_kv