diff --git a/tm_admin/pgsupport.py b/tm_admin/pgsupport.py index 554724d..4f49abc 100755 --- a/tm_admin/pgsupport.py +++ b/tm_admin/pgsupport.py @@ -164,14 +164,13 @@ async def insertRecords(self, # It's for a jsonb column # a dict uses single quotes, postgres wants double quotes. # newval = str(value).replace("'", '"') - breakpoint() for entry in value[key]: for k, v in entry.items(): if str(type(v))[:5] == " 0: @@ -397,7 +400,7 @@ async def updateJsonb(self, data += f'" {v}", ' #asc = str(entry).replace("'", '"').replace("\\'", "'") sql = "UPDATE %s SET %s = '{\"%s\": [%s]}' WHERE id=%d AND project_id=%d" % (self.table, column, column, data[:-2], task_id, project_id) - print(sql) + # print(sql) result = await self.execute(sql) async def appendJsonb(self, diff --git a/tm_admin/teams/teams.py b/tm_admin/teams/teams.py index f7cb2dd..a3c04f7 100755 --- a/tm_admin/teams/teams.py +++ b/tm_admin/teams/teams.py @@ -99,7 +99,7 @@ async def mergeTeams(self, # sql = f"UPDATE teams SET team_members.team={record['team_id']}, team_members.active={record['active']}, team_members.function='{tmfunc.name}' WHERE id={record['team_id']}" # UPDATE teams SET team_members = '{"13": [{"user_id": 629, "function": 1, "active": true}, {"user_id": 111, "function": 2, "active": true}]}'; sql = "UPDATE teams SET team_members = '{\"members\": %s}' WHERE id=%d;" % (asc, id) - #print(sql) + print(sql) result = await self.pg.execute(sql) timer.stop()