Source

django / django / db / backends / util.py

Diff from to

django/db/backends/util.py

         self.cursor = cursor
         self.db = db
 
-    def __getattr__(self, attr):
+    def set_dirty(self):
         if self.db.is_managed():
             self.db.set_dirty()
+
+    def __getattr__(self, attr):
+        self.set_dirty()
         if attr in self.__dict__:
             return self.__dict__[attr]
         else:
 class CursorDebugWrapper(CursorWrapper):
 
     def execute(self, sql, params=()):
+        self.set_dirty()
         start = time()
         try:
             return self.cursor.execute(sql, params)
             )
 
     def executemany(self, sql, param_list):
+        self.set_dirty()
         start = time()
         try:
             return self.cursor.executemany(sql, param_list)