[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r5229 - trunk/gnue-common/src/datasources/drivers/DBSIG2
From: |
jan |
Subject: |
r5229 - trunk/gnue-common/src/datasources/drivers/DBSIG2 |
Date: |
Fri, 5 Mar 2004 11:43:34 -0600 (CST) |
Author: jan
Date: 2004-03-05 11:43:33 -0600 (Fri, 05 Mar 2004)
New Revision: 5229
Modified:
trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
trunk/gnue-common/src/datasources/drivers/DBSIG2/RecordSet.py
Log:
catch errors, if unicode statements are passed to DBSIG2 dbdrivers
and convert unicode to normal string type
Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
2004-03-05 14:39:58 UTC (rev 5228)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
2004-03-05 17:43:33 UTC (rev 5229)
@@ -202,7 +202,11 @@
def _getQueryCount(self,conditions={},sql=""):
cursor = self._connection.native.cursor()
- cursor.execute(self._buildQueryCount(conditions,additionalSQL=sql))
+ try:
+ cursor.execute(self._buildQueryCount(conditions, additionalSQL=sql))
+ except TypeError:
+ cursor.execute(str(self._buildQueryCount(conditions, additionalSQL=sql)))
+
rs = cursor.fetchone()
return int(rs[0])
Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/RecordSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/RecordSet.py
2004-03-05 14:39:58 UTC (rev 5228)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/RecordSet.py
2004-03-05 17:43:33 UTC (rev 5229)
@@ -56,7 +56,13 @@
GDebug.printMesg(5, "_postChanges: statement=%s" % statement)
try:
- self._parent._update_cursor.execute(statement)
+ try:
+ self._parent._update_cursor.execute(statement)
+
+ # catch errors, raised, if unicode type isn't accepted
+ except TypeError:
+ # TODO: move this conversion into statement creation
+ self._parent._update_cursor.execute(str(statement))
# Set _initialData to be the just-now posted values
if not self._deleteFlag:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r5229 - trunk/gnue-common/src/datasources/drivers/DBSIG2,
jan <=