Commits

Remy Blank committed f604692

ticket: Converted `env.get_db_cnx() -> env.get_read_db()` in the ticket model objects.

  • Participants
  • Parent commits c0a4922

Comments (0)

Files changed (1)

File trac/ticket/model.py

         self._old = {}
 
     def _get_db(self, db):
-        return db or self.env.get_db_cnx()
+        return db or self.env.get_read_db()
 
     exists = property(fget=lambda self: self.id is not None)
 
         self.env = env
         if name:
             if not db:
-                db = self.env.get_db_cnx()
+                db = self.env.get_read_db()
             cursor = db.cursor()
             cursor.execute("SELECT value FROM enum WHERE type=%s AND name=%s",
                            (self.type, name))
     @classmethod
     def select(cls, env, db=None):
         if not db:
-            db = env.get_db_cnx()
+            db = env.get_read_db()
         cursor = db.cursor()
         cursor.execute("""
             SELECT name,value FROM enum WHERE type=%s 
         self.env = env
         if name:
             if not db:
-                db = self.env.get_db_cnx()
+                db = self.env.get_read_db()
             cursor = db.cursor()
             cursor.execute("""
                 SELECT owner,description FROM component WHERE name=%s
     @classmethod
     def select(cls, env, db=None):
         if not db:
-            db = env.get_db_cnx()
+            db = env.get_read_db()
         cursor = db.cursor()
         cursor.execute("""
             SELECT name,owner,description FROM component ORDER BY name
 
     def _fetch(self, name, db=None):
         if not db:
-            db = self.env.get_db_cnx()
+            db = self.env.get_read_db()
         cursor = db.cursor()
         cursor.execute("""
             SELECT name,due,completed,description 
     @classmethod
     def select(cls, env, include_completed=True, db=None):
         if not db:
-            db = env.get_db_cnx()
+            db = env.get_read_db()
         sql = "SELECT name,due,completed,description FROM milestone "
         if not include_completed:
             sql += "WHERE COALESCE(completed,0)=0 "
         self.env = env
         if name:
             if not db:
-                db = self.env.get_db_cnx()
+                db = self.env.get_read_db()
             cursor = db.cursor()
             cursor.execute("""
                 SELECT time,description FROM version WHERE name=%s
     @classmethod
     def select(cls, env, db=None):
         if not db:
-            db = env.get_db_cnx()
+            db = env.get_read_db()
         cursor = db.cursor()
         cursor.execute("SELECT name,time,description FROM version")
         versions = []