def __update_rows(self, request, schema, table, row, row_id=None): context = { "connection_id": request.data["connection_id"], "cursor_id": request.data["cursor_id"], "user": request.user, } where = request.GET.getlist("where") query = {"schema": schema, "table": table, "values": row} if where: query["where"] = self.__read_where_clause(where) if row_id: clause = { "operator": "=", "operands": [ actions._load_value(row_id), {"type": "column", "column": "id"}, ], "type": "operator", } where = query.get("where") if where: clause = conjunction([clause, where]) query["where"] = clause return actions.data_update(query, context)
def __update_rows(self, request, schema, table, row, row_id=None): context = { 'connection_id': request.data['connection_id'], 'cursor_id': request.data['cursor_id'], 'user': request.user } where = request.GET.getlist('where') query = {'schema': schema, 'table': table, 'values': row} if where: query['where'] = self.__read_where_clause(where) if row_id: clause = { 'operator': '=', 'operands': [ actions._load_value(row_id), { 'type': 'column', 'column': 'id' } ], 'type': 'operator' } where = query.get('where') if where: clause = conjunction([clause, where]) query['where'] = clause return actions.data_update(query, context)
def __update_rows(self, request, schema, table, row, row_id=None): context = {'cursor_id': request.data['cursor_id'], 'user': request.user} where = request.GET.get('where') query = { 'schema': schema, 'table': table, 'where': self.__read_where_clause(where), 'values': row } if row_id: query['where'].append({ 'left': { 'type': 'column', 'column': 'id' }, 'operator': '=', 'right': actions._load_value(row_id), 'type': 'operator_binary' }) return actions.data_update(query, context)