]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added debug-level row echoing to RowProxy (moved from ResultProxy)
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Oct 2006 17:05:47 +0000 (17:05 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Oct 2006 17:05:47 +0000 (17:05 +0000)
lib/sqlalchemy/engine/base.py

index 4251c581081f04e7bac65fc06b4e89ccccbf8513..a1c6af643758bfb0faa5b1f777851414d4b11a70 100644 (file)
@@ -641,8 +641,6 @@ class ResultProxy:
         """fetch one row, just like DBAPI cursor.fetchone()."""
         row = self.cursor.fetchone()
         if row is not None:
-            if self.__echo:
-                self.engine.logger.debug("Row " + repr(row))
             return RowProxy(self, row)
         else:
             # controversy!  can we auto-close the cursor after results are consumed ?
@@ -670,6 +668,8 @@ class RowProxy:
         """RowProxy objects are constructed by ResultProxy objects."""
         self.__parent = parent
         self.__row = row
+        if self.__parent._ResultProxy__echo:
+            self.__parent.engine.logger.debug("Row " + repr(row))
     def close(self):
         self.__parent.close()
     def __iter__(self):