[Zope-CVS] CVS: Products/DCOracle2 - db.py:1.9

Matthew T. Kromer matt@zope.com
Tue, 2 Oct 2001 17:13:58 -0400


Update of /cvs-repository/Products/DCOracle2
In directory cvs.zope.org:/tmp/cvs-serv3246

Modified Files:
	db.py 
Log Message:
Convert OracleDates to Zope DateTime objects on return


=== Products/DCOracle2/db.py 1.8 => 1.9 ===
     # Do we get tuples back in results? should just be lists
     #
-    def _lobConvert(self, result):
+    def _lobConvert(self, result, listtype=type([])):
         for i in xrange(len(result)):
             t = type(result[i])
-            if t == type([]): self._lobConvert(result[i])
+            if t == listtype: self._lobConvert(result[i])
             elif t == DCOracle2.dco2.LobLocatorType:
                 result[i] = LobLocator(result[i])
+            elif t == DCOracle2.dco2.OracleDateType:
+                result[i] = DateTime.DateTime(float(result[i]))
 
     # Added for ChrisM (11/13/2000 MTK)
     def commit_sub(self, *arg, **kw):