diff --git a/tm_admin/pgsupport.py b/tm_admin/pgsupport.py index da7020b..5ace7ec 100755 --- a/tm_admin/pgsupport.py +++ b/tm_admin/pgsupport.py @@ -146,9 +146,11 @@ async def insertRecords(self, return False data = dict() + jcol = dict() for entry in records: for key, value in entry.data.items(): val = self.types[key] + # print(type(val), value) if not value: continue if type(value) == list: @@ -157,11 +159,23 @@ async def insertRecords(self, elif type(value) == dict: # It's for a jsonb column # a dict uses single quotes, postgres wants double quotes. - newval = str(value).replace("'", '"') - data[key] = f"{newval}" - continue + # newval = str(value).replace("'", '"') + breakpoint() + for entry in value[key]: + for k, v in entry.items(): + if str(type(v))[:5] == "