Merge branch 'master' into Develop

This commit is contained in:
Ozzie Isaacs
2021-10-24 09:49:42 +02:00
87 changed files with 16529 additions and 12200 deletions
+5 -2
View File
@@ -394,7 +394,7 @@ class AlchemyEncoder(json.JSONEncoder):
if isinstance(o.__class__, DeclarativeMeta):
# an SQLAlchemy class
fields = {}
for field in [x for x in dir(o) if not x.startswith('_') and x != 'metadata' and x!="password"]:
for field in [x for x in dir(o) if not x.startswith('_') and x != 'metadata' and x != "password"]:
if field == 'books':
continue
data = o.__getattribute__(field)
@@ -403,8 +403,11 @@ class AlchemyEncoder(json.JSONEncoder):
data = data.replace("'", "\'")
elif isinstance(data, InstrumentedList):
el = list()
# ele = None
for ele in data:
if ele.get:
if hasattr(ele, 'value'): # converter for custom_column values
el.append(str(ele.value))
elif ele.get:
el.append(ele.get())
else:
el.append(json.dumps(ele, cls=AlchemyEncoder))