def get_ticket_relations(self): relations = set() db = self.env.get_db_cnx() cursor = db.cursor() query = """SELECT ticket FROM ticket_custom WHERE name = 'code_comment_relation' AND (value LIKE '%(comment_id)d' OR value LIKE '%(comment_id)d,%%' OR value LIKE '%%,%(comment_id)d' OR value LIKE '%%,%(comment_id)d,%%')""" % {'comment_id': self.id} result = {} @self.env.with_transaction() def get_ticket_ids(db): cursor = db.cursor() cursor.execute(query) result['tickets'] = cursor.fetchall() return set([int(row[0]) for row in result['tickets']])
def delete_comment(db): cursor = db.cursor() cursor.execute("DELETE FROM code_comments WHERE id=%s", [self.id])
def get_ticket_ids(db): cursor = db.cursor() cursor.execute(query) result['tickets'] = cursor.fetchall()