[Zope-CVS] CVS: Products/AdaptableStorage/gateway_sql - PsycopgConnection.py:1.3 SQLRemainder.py:1.3

Shane Hathaway shane@zope.com
Tue, 10 Dec 2002 17:51:37 -0500


Update of /cvs-repository/Products/AdaptableStorage/gateway_sql
In directory cvs.zope.org:/tmp/cvs-serv29122/gateway_sql

Modified Files:
	PsycopgConnection.py SQLRemainder.py 
Log Message:
With minor corrections, successfully created a CMF site in a Postgres database.
Awesome. :-)


=== Products/AdaptableStorage/gateway_sql/PsycopgConnection.py 1.2 => 1.3 ===
--- Products/AdaptableStorage/gateway_sql/PsycopgConnection.py:1.2	Tue Dec 10 17:27:00 2002
+++ Products/AdaptableStorage/gateway_sql/PsycopgConnection.py	Tue Dec 10 17:51:37 2002
@@ -42,8 +42,10 @@
         cursor.execute(text, kw)
         if fetch:
             return cursor.fetchall()
-        else:
-            return None
+        return None
+
+    def asBinary(self, data):
+        return psycopg.Binary(data)
 
     def begin(self):
         pass


=== Products/AdaptableStorage/gateway_sql/SQLRemainder.py 1.2 => 1.3 ===
--- Products/AdaptableStorage/gateway_sql/SQLRemainder.py:1.2	Tue Dec 10 17:27:00 2002
+++ Products/AdaptableStorage/gateway_sql/SQLRemainder.py	Tue Dec 10 17:51:37 2002
@@ -78,7 +78,7 @@
     def store(self, event, state):
         key = int(event.getKeychain()[-1])
         items = self.execute(read_sql, 1, key=key)
-        kw = {'key': key, 'pickle': state}
+        kw = {'key': key, 'pickle': self.conn.asBinary(state)}
         if items:
             # update.
             self.execute(update_sql, **kw)