Partidas BOM y partes para SCAI

This commit is contained in:
2026-03-11 11:11:36 -05:00
parent 2ac07b55b6
commit 9f3ae8db42
34 changed files with 5101 additions and 1040 deletions

View File

@@ -29,8 +29,14 @@ def serialize_value(value: Any) -> Any:
elif isinstance(value, dict):
return {key: serialize_value(val) for key, val in value.items()}
else:
# For any other type, try to return as-is (str, int, float, bool, None)
# If it fails JSON serialization later, at least we tried
if hasattr(value, "__dict__"):
d = dict(value.__dict__)
d.pop("_sa_instance_state", None)
return {k: serialize_value(v) for k, v in d.items()}
if not isinstance(value, (int, float, str, bool)):
return str(value)
return value