Update of /usr/cvs/Public/pygresql/module
In directory druid.net:/tmp/cvs-serv4452/module

Modified Files:
        TEST_PyGreSQL_dbapi20.py pgdb.py 
Log Message:
Provide readable cursor attribute "connection" (this is one of the optional DB 
API extensions).
To see the diffs for this commit:
   
http://www.druid.net/pygresql/viewcvs.cgi/cvs/pygresql/module/TEST_PyGreSQL_dbapi20.py.diff?r1=1.11&r2=1.12

Index: TEST_PyGreSQL_dbapi20.py
===================================================================
RCS file: /usr/cvs/Public/pygresql/module/TEST_PyGreSQL_dbapi20.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TEST_PyGreSQL_dbapi20.py    21 Nov 2008 21:30:58 -0000      1.11
+++ TEST_PyGreSQL_dbapi20.py    23 Nov 2008 11:45:54 -0000      1.12
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# $Id: TEST_PyGreSQL_dbapi20.py,v 1.11 2008/11/21 21:30:58 cito Exp $
+# $Id: TEST_PyGreSQL_dbapi20.py,v 1.12 2008/11/23 11:45:54 cito Exp $
 
 import dbapi20
 import unittest
@@ -92,6 +92,11 @@
     def test_setoutputsize(self):
         pass # not implemented
 
+    def test_cursor_connection(self):
+        con = self._connect()
+        curs = con.cursor()
+        self.assertEqual(curs.connection, con)
+
     def test_pgdb_type(self):
         self.assertEqual(pgdb.STRING, pgdb.STRING)
         self.assertNotEqual(pgdb.STRING, pgdb.INTEGER)

   
http://www.druid.net/pygresql/viewcvs.cgi/cvs/pygresql/module/pgdb.py.diff?r1=1.50&r2=1.51

Index: pgdb.py
===================================================================
RCS file: /usr/cvs/Public/pygresql/module/pgdb.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- pgdb.py     21 Nov 2008 22:06:34 -0000      1.50
+++ pgdb.py     23 Nov 2008 11:45:54 -0000      1.51
@@ -4,7 +4,7 @@
 #
 # Written by D'Arcy J.M. Cain
 #
-# $Id: pgdb.py,v 1.50 2008/11/21 22:06:34 cito Exp $
+# $Id: pgdb.py,v 1.51 2008/11/23 11:45:54 cito Exp $
 #
 
 """pgdb - DB-API 2.0 compliant module for PygreSQL.
@@ -163,7 +163,7 @@
 
     def __init__(self, dbcnx):
         """Create a cursor object for the database connection."""
-        self._dbcnx = dbcnx
+        self.connection = self._dbcnx = dbcnx
         self._cnx = dbcnx._cnx
         self._type_cache = dbcnx._type_cache
         self._src = self._cnx.source()

_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql

Reply via email to