[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/common/src GConditions.py dbdrivers/_dbsig...
From: |
Jason Cater |
Subject: |
gnue/common/src GConditions.py dbdrivers/_dbsig... |
Date: |
Thu, 10 Jan 2002 17:42:19 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/01/10 17:42:19
Modified files:
common/src : GConditions.py
common/src/dbdrivers/_dbsig: DBdriver.py
common/src/dbdrivers/geas: DBdriver.py
Log message:
fixed conditional support for Fields and Const to be compatable
w/designer
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GConditions.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/_dbsig/DBdriver.py.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/geas/DBdriver.py.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
Patches:
Index: gnue/common/src/GConditions.py
diff -c gnue/common/src/GConditions.py:1.8 gnue/common/src/GConditions.py:1.9
*** gnue/common/src/GConditions.py:1.8 Thu Jan 10 15:59:17 2002
--- gnue/common/src/GConditions.py Thu Jan 10 17:42:19 2002
***************
*** 102,108 ****
class GCField (GConditionElement):
def __init__(self, parent, name=None, datatype="char"):
! GConditionElement.__init__(self, parent, 'GCField')
self.type = datatype
self.name = name
--- 102,108 ----
class GCField (GConditionElement):
def __init__(self, parent, name=None, datatype="char"):
! GConditionElement.__init__(self, parent, 'GCCField')
self.type = datatype
self.name = name
***************
*** 117,123 ****
class GCConst (GConditionElement):
def __init__(self, parent, value=None, datatype="char"):
! GConditionElement.__init__(self, parent, 'GCConst')
self.type = datatype
self.value = value
--- 117,123 ----
class GCConst (GConditionElement):
def __init__(self, parent, value=None, datatype="char"):
! GConditionElement.__init__(self, parent, 'GCCConst')
self.type = datatype
self.value = value
Index: gnue/common/src/dbdrivers/_dbsig/DBdriver.py
diff -c gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.32
gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.33
*** gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.32 Thu Jan 10 15:59:17 2002
--- gnue/common/src/dbdrivers/_dbsig/DBdriver.py Thu Jan 10 17:42:19 2002
***************
*** 164,170 ****
# TODO: and raises this error ALOT need to find out why
# TODO: BTW - This should not be in here :(
#
! # TODO: Since popy fails the fetchmany() with
if rsets and len(rsets):
for rs in(rsets):
if rs:
--- 164,170 ----
# TODO: and raises this error ALOT need to find out why
# TODO: BTW - This should not be in here :(
#
! # TODO: Since popy fails the fetchmany() with
if rsets and len(rsets):
for rs in(rsets):
if rs:
***************
*** 303,311 ****
# Note that we strip the GC from the object types and lowercase the rest
otype = string.lower(element.getObjectType()[2:])
#print "Otype: ",otype
! if otype == 'field':
return "%s" % element.name
! elif otype == 'const':
if element.value == None:
return "NULL"
elif element.type == 'number':
--- 303,311 ----
# Note that we strip the GC from the object types and lowercase the rest
otype = string.lower(element.getObjectType()[2:])
#print "Otype: ",otype
! if otype == 'cfield':
return "%s" % element.name
! elif otype == 'cconst':
if element.value == None:
return "NULL"
elif element.type == 'number':
***************
*** 341,361 ****
pass
! class DBSIG_DataObject_Object:
def __init__(self):
! # TODO: A dummy placeholder to let old db driver work
# TODO: each can have their *_DataObject_Object object from __init__ing
# TODO: DBSIG_DataObject_Object
! GDebug.printMesg(0,
"Database driver needs updated to not initialize
DBSIG_DataObject_Object")
! def _buildQuery(self, conditions={}):
GDebug.printMesg(7,'Implicit Fields: %s' % self._fieldReferences)
! if len(self._fieldReferences):
q = "SELECT %s FROM %s%s" % \
! (string.join(self._fieldReferences.keys(),","), self.table,
self._conditionToSQL(conditions))
! else:
q = "SELECT * FROM %s%s" % (self.table,
self._conditionToSQL(conditions))
if hasattr(self,'order_by'):
--- 341,361 ----
pass
! class DBSIG_DataObject_Object:
def __init__(self):
! # TODO: A dummy placeholder to let old db driver work
# TODO: each can have their *_DataObject_Object object from __init__ing
# TODO: DBSIG_DataObject_Object
! GDebug.printMesg(0,
"Database driver needs updated to not initialize
DBSIG_DataObject_Object")
! def _buildQuery(self, conditions={}):
GDebug.printMesg(7,'Implicit Fields: %s' % self._fieldReferences)
! if len(self._fieldReferences):
q = "SELECT %s FROM %s%s" % \
! (string.join(self._fieldReferences.keys(),","), self.table,
self._conditionToSQL(conditions))
! else:
q = "SELECT * FROM %s%s" % (self.table,
self._conditionToSQL(conditions))
if hasattr(self,'order_by'):
***************
*** 372,378 ****
return q
! class DBSIG_DataObject_SQL:
def _buildQuery(self, conditions={}):
# Obviously, this is in a pre-alpha state :)
return "select zipcode, city, state from zipcode order by zipcode desc"
--- 372,378 ----
return q
! class DBSIG_DataObject_SQL:
def _buildQuery(self, conditions={}):
# Obviously, this is in a pre-alpha state :)
return "select zipcode, city, state from zipcode order by zipcode desc"
Index: gnue/common/src/dbdrivers/geas/DBdriver.py
diff -c gnue/common/src/dbdrivers/geas/DBdriver.py:1.22
gnue/common/src/dbdrivers/geas/DBdriver.py:1.23
*** gnue/common/src/dbdrivers/geas/DBdriver.py:1.22 Wed Jan 2 22:19:14 2002
--- gnue/common/src/dbdrivers/geas/DBdriver.py Thu Jan 10 17:42:19 2002
***************
*** 107,115 ****
'sub': (2, 999, None, 'None' ),
'mul': (2, 999, None, 'None' ),
'div': (2, 999, None, 'None' ),
! 'and': (1, 999, None, 'None' ),
! 'or': (2, 999, None, 'None' ),
! 'not': (1, 1, None, 'None' ),
'negate': (1, 1, None, 'None' ),
'eq': (2, 2, 'queryObject.addField(GEAS.Query.Field(
field="%s", test=GEAS.Query.equals,' + \
'invert=CORBA.FALSE,casesensitive=CORBA.FALSE,value=%s))', None
),
--- 107,115 ----
'sub': (2, 999, None, 'None' ),
'mul': (2, 999, None, 'None' ),
'div': (2, 999, None, 'None' ),
! 'and': (1, 999, None, 'None' ),
! 'or': (2, 999, None, 'None' ),
! 'not': (1, 1, None, 'None' ),
'negate': (1, 1, None, 'None' ),
'eq': (2, 2, 'queryObject.addField(GEAS.Query.Field(
field="%s", test=GEAS.Query.equals,' + \
'invert=CORBA.FALSE,casesensitive=CORBA.FALSE,value=%s))', None
),
***************
*** 124,130 ****
# 'between': (3, 3, '%s BETWEEN %s AND %s', None )
}
! def __init__(self):
GDataObjects.DataObject.__init__(self)
GDebug.printMesg (1,"GEAS database driver backend initializing")
--- 124,130 ----
# 'between': (3, 3, '%s BETWEEN %s AND %s', None )
}
! def __init__(self):
GDataObjects.DataObject.__init__(self)
GDebug.printMesg (1,"GEAS database driver backend initializing")
***************
*** 153,169 ****
# TODO: (jcater) I'm not so sure about guest logins. This
# TODO: (jcater) should be discussed. At a minimum, I think
! # TODO: (jcater) we need gnue.conf flags:
# TODO: (jcater) allowGuestLogin = [0|1]
# TODO: (jcater) guestLogin = guest
# TODO: (jcater) allowBlankLogin = [0|1]
self._dataConnection = self._factory.guestLogin()
else:
! # TODO: (jcater) The GEAS docs say this is not supported and
! # TODO: (jcater) CORBA-based security should instead be used.
! # TODO: (jcater) As I don't know jack about CORBA security,
! # TODO: (jcater) this will have to do for now (even though,
# TODO: (jcater) IIRC, is does nothing to validate the user/pass
# TODO: (jcater) supplied to it.)
self._dataConnection = self._factory.unsecureLogin(user,passwd)
--- 153,169 ----
# TODO: (jcater) I'm not so sure about guest logins. This
# TODO: (jcater) should be discussed. At a minimum, I think
! # TODO: (jcater) we need gnue.conf flags:
# TODO: (jcater) allowGuestLogin = [0|1]
# TODO: (jcater) guestLogin = guest
# TODO: (jcater) allowBlankLogin = [0|1]
self._dataConnection = self._factory.guestLogin()
else:
! # TODO: (jcater) The GEAS docs say this is not supported and
! # TODO: (jcater) CORBA-based security should instead be used.
! # TODO: (jcater) As I don't know jack about CORBA security,
! # TODO: (jcater) this will have to do for now (even though,
# TODO: (jcater) IIRC, is does nothing to validate the user/pass
# TODO: (jcater) supplied to it.)
self._dataConnection = self._factory.unsecureLogin(user,passwd)
***************
*** 212,220 ****
else:
print ":"*count, conditionTree.getObjectType()
otype = string.lower(conditionTree.getObjectType()[2:])
! if otype == 'field':
return "%s" % conditionTree.name
! elif otype == 'const':
if conditionTree.value == None:
return "NULL"
elif conditionTree.type == 'number':
--- 212,220 ----
else:
print ":"*count, conditionTree.getObjectType()
otype = string.lower(conditionTree.getObjectType()[2:])
! if otype == 'cfield':
return "%s" % conditionTree.name
! elif otype == 'cconst':
if conditionTree.value == None:
return "NULL"
elif conditionTree.type == 'number':
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/common/src GConditions.py dbdrivers/_dbsig...,
Jason Cater <=