[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/common/src/datasources GDataObjects.py dri...
From: |
Jan Ischebeck |
Subject: |
gnue/common/src/datasources GDataObjects.py dri... |
Date: |
Tue, 29 Apr 2003 15:25:17 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jan Ischebeck <address@hidden> 03/04/29 15:25:17
Modified files:
common/src/datasources: GDataObjects.py
common/src/datasources/drivers/DBSIG2: Driver.py
common/src/datasources/drivers/postgresql/popy: Driver.py
common/src/datasources/drivers/postgresql/pypgsql: Driver.py
common/src/datasources/drivers/postgresql/pygresql: Driver.py
common/src/datasources/drivers/postgresql/psycopg: Driver.py
Log message:
Minor fix of additionalSQL for postgres and enabled db encoding for
query parameters
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/datasources/GDataObjects.py.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/datasources/drivers/DBSIG2/Driver.py.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/datasources/drivers/postgresql/popy/Driver.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/datasources/drivers/postgresql/pypgsql/Driver.py.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/datasources/drivers/postgresql/pygresql/Driver.py.diff?tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/datasources/drivers/postgresql/psycopg/Driver.py.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
Patches:
Index: gnue/common/src/datasources/GDataObjects.py
diff -c gnue/common/src/datasources/GDataObjects.py:1.67
gnue/common/src/datasources/GDataObjects.py:1.68
*** gnue/common/src/datasources/GDataObjects.py:1.67 Tue Apr 1 00:23:00 2003
--- gnue/common/src/datasources/GDataObjects.py Tue Apr 29 15:25:16 2003
***************
*** 127,133 ****
readOnly=readOnly, masterRecordSet=masterRecordSet, sql=sql)
# Designed to be replaced by vendor-specific code
! def _createResultSet(self, conditions={}, readOnly=0, masterRecordSet=None):
pass
# Do not over-ride by vendor code
--- 127,134 ----
readOnly=readOnly, masterRecordSet=masterRecordSet, sql=sql)
# Designed to be replaced by vendor-specific code
! def _createResultSet(self, conditions={}, readOnly=0, masterRecordSet=None,
\
! sql=""):
pass
# Do not over-ride by vendor code
Index: gnue/common/src/datasources/drivers/DBSIG2/Driver.py
diff -c gnue/common/src/datasources/drivers/DBSIG2/Driver.py:1.67
gnue/common/src/datasources/drivers/DBSIG2/Driver.py:1.68
*** gnue/common/src/datasources/drivers/DBSIG2/Driver.py:1.67 Mon Feb 17
02:32:48 2003
--- gnue/common/src/datasources/drivers/DBSIG2/Driver.py Tue Apr 29
15:25:17 2003
***************
*** 252,262 ****
return "%d" % value
else:
return str(value)
else:
! return "'%s'" % string.replace(str(value),"'",
"%s'" % self._escapeSingleQuote)
# This should be over-ridden only if driver needs more than user/pass
def getLoginFields(self):
return [['_username', 'User Name',0],['_password', 'Password',1]]
--- 252,272 ----
return "%d" % value
else:
return str(value)
+
+ elif type(value) == types.UnicodeType:
+ return "'%s'" %
string.replace(value.encode(gConfig("textEncoding")),"'",
+ "%s'" % self._escapeSingleQuote)
else:
!
! try:
! return "'%s'" % string.replace(str(value),"'",
! "%s'" % self._escapeSingleQuote)
! except:
! return "'%s'" % string.replace(value,"'",
"%s'" % self._escapeSingleQuote)
+
# This should be over-ridden only if driver needs more than user/pass
def getLoginFields(self):
return [['_username', 'User Name',0],['_password', 'Password',1]]
***************
*** 280,286 ****
recordCount = self._getQueryCount(conditions,sql)
cursor.arraysize = self.cache
! cursor.execute(self._buildQuery(conditions,sql=sql))
except self._DatabaseError, err:
raise GDataObjects.ConnectionError, err
--- 290,296 ----
recordCount = self._getQueryCount(conditions,sql)
cursor.arraysize = self.cache
! cursor.execute(self._buildQuery(conditions, additionalSQL=sql))
except self._DatabaseError, err:
raise GDataObjects.ConnectionError, err
***************
*** 296,302 ****
def _getQueryCount(self,conditions={},sql=""):
cursor = self._dataConnection.cursor()
! cursor.execute(self._buildQueryCount(conditions,sql))
rs = cursor.fetchone()
return int(rs[0])
--- 306,312 ----
def _getQueryCount(self,conditions={},sql=""):
cursor = self._dataConnection.cursor()
! cursor.execute(self._buildQueryCount(conditions,additionalSQL=sql))
rs = cursor.fetchone()
return int(rs[0])
Index: gnue/common/src/datasources/drivers/postgresql/popy/Driver.py
diff -c gnue/common/src/datasources/drivers/postgresql/popy/Driver.py:1.17
gnue/common/src/datasources/drivers/postgresql/popy/Driver.py:1.18
*** gnue/common/src/datasources/drivers/postgresql/popy/Driver.py:1.17 Tue Feb
18 14:34:59 2003
--- gnue/common/src/datasources/drivers/postgresql/popy/Driver.py Tue Apr
29 15:25:17 2003
***************
*** 84,91 ****
# PGSQL_DataObject_Object.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,sql=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions, forDetail,
sql)
class PG_DataObject_SQL(PG_DataObject, \
--- 84,92 ----
# PGSQL_DataObject_Object.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,additionalSQL=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions, forDetail,\
! additionalSQL)
class PG_DataObject_SQL(PG_DataObject, \
***************
*** 96,103 ****
# PGSQL_DataObject_SQL.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={}):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions)
#
--- 97,105 ----
# PGSQL_DataObject_SQL.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,additionalSQL=""):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions, forDetail,\
! additionalSQL)
#
Index: gnue/common/src/datasources/drivers/postgresql/psycopg/Driver.py
diff -c gnue/common/src/datasources/drivers/postgresql/psycopg/Driver.py:1.16
gnue/common/src/datasources/drivers/postgresql/psycopg/Driver.py:1.17
*** gnue/common/src/datasources/drivers/postgresql/psycopg/Driver.py:1.16
Tue Feb 18 14:34:59 2003
--- gnue/common/src/datasources/drivers/postgresql/psycopg/Driver.py Tue Apr
29 15:25:17 2003
***************
*** 55,70 ****
def __init__(self):
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None, sql=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions,forDetail,sql)
class PG_DataObject_SQL(PG_DataObject, \
PGSQL_DataObject_SQL):
def __init__(self):
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={}):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions)
#
# Extensions to Trigger Namespaces
--- 55,72 ----
def __init__(self):
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None, additionalSQL=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions,forDetail,\
! additionalSQL)
class PG_DataObject_SQL(PG_DataObject, \
PGSQL_DataObject_SQL):
def __init__(self):
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None, additionalSQL=""):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions,forDetail,
! additionalSQL)
#
# Extensions to Trigger Namespaces
Index: gnue/common/src/datasources/drivers/postgresql/pygresql/Driver.py
diff -c gnue/common/src/datasources/drivers/postgresql/pygresql/Driver.py:1.39
gnue/common/src/datasources/drivers/postgresql/pygresql/Driver.py:1.40
*** gnue/common/src/datasources/drivers/postgresql/pygresql/Driver.py:1.39
Tue Feb 18 14:34:59 2003
--- gnue/common/src/datasources/drivers/postgresql/pygresql/Driver.py Tue Apr
29 15:25:17 2003
***************
*** 94,109 ****
PGSQL_DataObject_Object.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,sql=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions,
forDetail,sql)
class PG_DataObject_SQL(PG_DataObject, PGSQL_DataObject_SQL):
def __init__(self):
PGSQL_DataObject_SQL.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={}):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions)
class TriggerExtensions(PGSQL_TriggerExtensions):
pass
--- 94,111 ----
PGSQL_DataObject_Object.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,additionalSQL=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions,
forDetail,\
! additionalSQL)
class PG_DataObject_SQL(PG_DataObject, PGSQL_DataObject_SQL):
def __init__(self):
PGSQL_DataObject_SQL.__init__(self)
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,additionalSQL=""):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions, forDetail,\
! additionalSQL)
class TriggerExtensions(PGSQL_TriggerExtensions):
pass
Index: gnue/common/src/datasources/drivers/postgresql/pypgsql/Driver.py
diff -c gnue/common/src/datasources/drivers/postgresql/pypgsql/Driver.py:1.30
gnue/common/src/datasources/drivers/postgresql/pypgsql/Driver.py:1.31
*** gnue/common/src/datasources/drivers/postgresql/pypgsql/Driver.py:1.30
Tue Feb 18 14:34:59 2003
--- gnue/common/src/datasources/drivers/postgresql/pypgsql/Driver.py Tue Apr
29 15:25:17 2003
***************
*** 95,102 ****
# some of its values
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,sql=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions,forDetail,sql)
class PG_DataObject_SQL(PG_DataObject, \
--- 95,103 ----
# some of its values
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,additionalSQL=""):
! return PGSQL_DataObject_Object._buildQuery(self, conditions,forDetail,\
! additionalSQL)
class PG_DataObject_SQL(PG_DataObject, \
***************
*** 106,113 ****
# some of its values
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={}):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions)
#
--- 107,115 ----
# some of its values
PG_DataObject.__init__(self)
! def _buildQuery(self, conditions={},forDetail=None,additionalSQL=""):
! return PGSQL_DataObject_SQL._buildQuery(self, conditions,forDetail,\
! additionalSQL)
#
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/common/src/datasources GDataObjects.py dri...,
Jan Ischebeck <=