json-as-dict
All checks were successful
Deploy on push / deploy (push) Successful in 24s

This commit is contained in:
Untone 2024-02-26 18:04:34 +03:00
parent 72aa96a99f
commit c905666591

View File

@ -1,3 +1,4 @@
import json
import math
import time
@ -52,8 +53,8 @@ class Base(declarative_base()):
for c in column_names:
value = getattr(self, c)
if isinstance(value, JSON):
# Cast JSON column to string
data[c] = str(value)
# save JSON column as dict
data[c] = json.loads(str(value))
else:
data[c] = value
return data