commit-gnue
[Top][All Lists]
Advanced

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

gnue gnue-common/src/GConditions.py gnue-common...


From: Jason Cater
Subject: gnue gnue-common/src/GConditions.py gnue-common...
Date: Wed, 19 Sep 2001 15:32:35 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/09/19 15:32:34

Modified files:
        gnue-common/src: GConditions.py 
        gnue-common/src/dbdrivers/postgresql: DBdriver.py 
        gnuef/src/GFObjects: GFBlock.py GFEntry.py 
        reports/src    : grrun 

Log message:
        fixed form's queryDefault support; fixed problem w/conditional 
combines; misc other fixes

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GConditions.py.diff?cvsroot=OldCVS&tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFBlock.py.diff?cvsroot=OldCVS&tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFEntry.py.diff?cvsroot=OldCVS&tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/grrun.diff?cvsroot=OldCVS&tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gnue/gnue-common/src/GConditions.py
diff -u gnue/gnue-common/src/GConditions.py:1.2 
gnue/gnue-common/src/GConditions.py:1.3
--- gnue/gnue-common/src/GConditions.py:1.2     Sun Aug 12 15:55:26 2001
+++ gnue/gnue-common/src/GConditions.py Wed Sep 19 15:32:34 2001
@@ -62,13 +62,13 @@
     cond1._children = cond2._children
     return cond1
   elif len(cond2._children): 
-    children = cond1._children
+    children = cond1._children[:]
     cond1._children = []
     _and = GCand(cond1)
-    _and._children 
+    _and._children = children
     if len(cond2._children) > 1: 
       _and2 = GCand(cond1)
-      _and2._children = cond2._children
+      _and2._children = cond2._children[:]
     else: 
       cond1._children.append(cond2._children[0])
 
Index: gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.19 
gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.20
--- gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.19  Tue Sep 18 
23:23:20 2001
+++ gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py       Wed Sep 19 
15:32:34 2001
@@ -59,9 +59,10 @@
   #### NOTE:  Once PyGreSQL's .fetchone() bug is fixed, this method
   ####   should be deleted!  Also note the line in PG_DataObject.__init__.
   ####   Right now, we are having to preload *ALL* rows from a datasource.
-  def _loadNextRecord(self):
-    if self._cursor:
-      try:
+  def _loadNextRecord(self): 
+    GDebug.printMesg(5,'_loadNextRecord() for %s' % self._dataObject.table)
+    if self._cursor: 
+      try: 
         rsall = self._cursor.fetchall()
       except self._dataObject._DatabaseError, err:
         raise GDataObjects.ConnectionError, err
Index: gnue/gnuef/src/GFObjects/GFBlock.py
diff -u gnue/gnuef/src/GFObjects/GFBlock.py:1.16 
gnue/gnuef/src/GFObjects/GFBlock.py:1.17
--- gnue/gnuef/src/GFObjects/GFBlock.py:1.16    Wed Sep 19 01:11:15 2001
+++ gnue/gnuef/src/GFObjects/GFBlock.py Wed Sep 19 15:32:34 2001
@@ -64,6 +64,7 @@
 
     self._currentRecord = 0
     self._recordCount = 0
+    self._queryDefaults = {}
     self._queryValues = {}
     self._lastQueryValues = {}
 
@@ -226,6 +227,9 @@
       self.mode = 'query'
       self._query2 = int(GConfig.get("RememberLastQuery","1"))
       self._queryValues = {}
+      for entry in self._queryDefaults.keys(): 
+        entry.setValue(self._queryDefaults[entry])
+      self.switchRecord(0)
     elif self._query2:
       self._query2 = 0
       self._queryValues = {}
@@ -264,11 +268,14 @@
       for entry in self._queryValues.keys():
         if entry._bound and entry.isQueryable(): 
           if entry.typecast == 'text': 
+            GDebug.printMesg(5,'Adding conditional LIKE (%s like %s)' % 
(entry.field, self._queryValues[entry]))
             conditionLike[entry.field] = self._queryValues[entry]
           else: 
+            GDebug.printMesg(5,'Adding conditional AND (%s=%s)' % 
(entry.field, self._queryValues[entry]))
             conditionEq[entry.field] = self._queryValues[entry]
 
       if len(conditionLike.keys()) and len(conditionEq.keys()): 
+        GDebug.printMesg(5,'Combining like w/and (%s, %s)' % (conditionLike, 
conditionEq))
         conditions = GConditions.combineConditions( \
             GConditions.buildConditionFromDict(conditionLike, 
GConditions.GClike), \
             GConditions.buildConditionFromDict(conditionEq, GConditions.GCeq) )
Index: gnue/gnuef/src/GFObjects/GFEntry.py
diff -u gnue/gnuef/src/GFObjects/GFEntry.py:1.18 
gnue/gnuef/src/GFObjects/GFEntry.py:1.19
--- gnue/gnuef/src/GFObjects/GFEntry.py:1.18    Wed Sep 19 01:27:44 2001
+++ gnue/gnuef/src/GFObjects/GFEntry.py Wed Sep 19 15:32:34 2001
@@ -116,9 +116,16 @@
       self.datasource = \
          self._block._form._datasourceDictionary[string.lower(datasourceName)]
 
+    if hasattr(self, 'queryDefault') and \
+         self.queryDefault != None and \
+         self._bound and \
+         len(self.queryDefault):
+      self._block._queryDefaults[self] = self.queryDefault
+    else:
+      default = None
 
   def isQueryable(self):
-    if self._queryable and len(self._oldval):
+    if self._queryable: # and len(self._oldval): #TODO: Why was this here?
       return 1
 
   #
Index: gnue/reports/src/grrun
diff -u gnue/reports/src/grrun:1.5 gnue/reports/src/grrun:1.6
--- gnue/reports/src/grrun:1.5  Tue Jun  5 11:57:08 2001
+++ gnue/reports/src/grrun      Wed Sep 19 15:32:34 2001
@@ -1,4 +1,4 @@
-#!/usr/bin/env python 
+#!/usr/local/bin/python2.1
 #
 # This file is part of GNU Enterprise.
 #



reply via email to

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