Partidas BOM y partes para SCAI
This commit is contained in:
@@ -33,6 +33,15 @@ def _make_json_safe(obj: Any) -> Any:
|
||||
return str(obj)
|
||||
if isinstance(obj, bytes):
|
||||
return obj.decode("utf-8", errors="replace")
|
||||
|
||||
if hasattr(obj, "__dict__"):
|
||||
d = dict(obj.__dict__)
|
||||
d.pop("_sa_instance_state", None)
|
||||
return {k: _make_json_safe(v) for k, v in d.items()}
|
||||
|
||||
if not isinstance(obj, (int, float, str, bool)):
|
||||
return str(obj)
|
||||
|
||||
return obj
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user