commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/gnue-common doc/CustomizedLoginHandlers.tx...


From: Jason Cater
Subject: gnue/gnue-common doc/CustomizedLoginHandlers.tx...
Date: Mon, 30 Jul 2001 23:06:45 -0700

CVSROOT:        /home/cvs
Module name:    gnue
Branch:         gnuef-new-datasources
Changes by:     Jason Cater <address@hidden>    01/07/30 23:06:45

Modified files:
        gnue-common/doc: CustomizedLoginHandlers.txt 
        gnue-common/src/dbdrivers/_dbsig: DBdriver.py 
        gnue-common/src/dbdrivers/oracle: DBdriver.py 

Log message:
        fixed bugs in not present in postgres driver but in other drivers

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/doc/CustomizedLoginHandlers.txt.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.1.2.1&tr2=1.1.2.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.7.2.3&tr2=1.7.2.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.4.2.2&tr2=1.4.2.3&r1=text&r2=text

Patches:
Index: gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.6 
gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.7
--- gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.6       Tue Jun  5 
18:22:55 2001
+++ gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py   Tue Jun  5 22:24:40 2001
@@ -146,11 +146,11 @@
 
 
   # Used to convert a condition tree to an sql where clause
-  def _conditionToSQL (condition): 
+  def _conditionToSQL (self, condition): 
     if condition == {} or condition == None: 
       return ""
     elif type(condition) == types.DictType: 
-      cond = GConditions.buildConditionFromDict(cond)
+      cond = GConditions.buildConditionFromDict(condition)
     else: 
       cond = condition
   
@@ -162,10 +162,10 @@
       _and = GConditions.GCand(cond)
       _and._children = chillun
   
-    return " WHERE (%s)" % (this.__conditionToSQL (cond._children[0]))
+    return " WHERE (%s)" % (self.__conditionToSQL (cond._children[0]))
   
   # Used internally by _conditionToSQL
-  def __conditionToSQL (element): 
+  def __conditionToSQL (self, element): 
     if type(element) != types.InstanceType: 
       return "%s" % element
     else: 
@@ -178,7 +178,7 @@
         return "'%s'" % element.getValue()
       elif self.conditionElements.has_key(otype): 
         for i in range(0, len(element._children)): 
-          element._children[i] = __conditionToSQL(element._children[i])
+          element._children[i] = self.__conditionToSQL(element._children[i])
         if len(element._children) < self.conditionElements[otype][0]: 
           raise GConditions.ConditionError, \
             'Condition element "%s" expects at least %s arguments; found %s' % 
\
Index: gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py:1.4 
gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py:1.5
--- gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py:1.4       Tue Jul 10 
14:30:10 2001
+++ gnue/gnue-common/src/dbdrivers/oracle/DBdriver.py   Thu Jul 12 20:56:31 2001
@@ -47,7 +47,8 @@
     GFDebug.printMesg(10,"Oracle DBdriver: Connect String: " 
         + dbuser + "/" + dbpasswd + "@" + dbname) 
     self.connectWithString (dbuser + "/" + dbpasswd + "@" + dbname)
-  
+    self.triggerExtensions = TriggerExtensions(self.connection)
+
   def connectWithString(self, dbConnectString):
     try:
       self.connection = DCOracle.Connect(dbConnectString)
@@ -263,3 +264,36 @@
   def getMaskCount(self):
     self.maskCount = self.maskCount + 1
     return self.maskCount - 1
+
+  
+
+#
+#  Extensions to Trigger Namespaces
+#  
+class TriggerExtensions: 
+
+  def __init__(self, connection): 
+    self.__connection = connection
+
+  # Return the current date, according to database
+  def getDate(self): 
+    cursor = self.__connection.cursor()
+    command = "select sysdate from dual"
+    cursor.execute(command)
+    return cursor.fetchone()[0]
+
+  # Return a sequence number from sequence 'name' 
+  def getSequence(self, name): 
+    cursor = self.__connection.cursor()
+    command = "select %s.nextval from dual" % name
+    cursor.execute(command)
+    return cursor.fetchone()[0]
+
+  # Run the SQL statement 'statement'
+  def sql(self, statement): 
+    self.__connection.cursor().execute(statement)
+
+
+
+
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]