コード例 #1
0
 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']])
コード例 #2
0
 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']])
コード例 #3
0
 def delete_comment(db):
     cursor = db.cursor()
     cursor.execute("DELETE FROM code_comments WHERE id=%s", [self.id])
コード例 #4
0
 def get_ticket_ids(db):
     cursor = db.cursor()
     cursor.execute(query)
     result['tickets'] = cursor.fetchall()
コード例 #5
0
 def delete_comment(db):
     cursor = db.cursor()
     cursor.execute("DELETE FROM code_comments WHERE id=%s", [self.id])
コード例 #6
0
 def get_ticket_ids(db):
     cursor = db.cursor()
     cursor.execute(query)
     result['tickets'] = cursor.fetchall()