|
@@ -1,5 +1,6 @@
|
|
from pyexpat import model
|
|
from pyexpat import model
|
|
from sys import modules
|
|
from sys import modules
|
|
|
|
+from tokenize import String
|
|
from sqlalchemy.ext.declarative import DeclarativeMeta
|
|
from sqlalchemy.ext.declarative import DeclarativeMeta
|
|
from sqlalchemy import null
|
|
from sqlalchemy import null
|
|
from utility.app_logging import *
|
|
from utility.app_logging import *
|
|
@@ -110,6 +111,17 @@ def setModelItemAttributesFromJson(Item, JsonString):
|
|
setattr(Item, key, attributes_dict[key])
|
|
setattr(Item, key, attributes_dict[key])
|
|
|
|
|
|
|
|
|
|
-def ModelObjectToJsonString(object):
|
|
|
|
|
|
+def ModelObjectToJsonString(object) -> str:
|
|
|
|
|
|
- return json.dumps(object, cls=ComplexEncoder)
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ json_string = json.dumps(object, cls=ComplexEncoder)
|
|
|
|
+ json_dict : dict = json.loads(json_string)
|
|
|
|
+ json_dict.pop("registry") # removing the registry item that comes from the sql alchemy type.
|
|
|
|
+ json_string = json.dumps(json_dict)
|
|
|
|
+
|
|
|
|
+ assert isinstance(json_string,str)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return json_string
|