commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnuef/src GFForm.py GFObjects/GFBlock.py G...


From: Jason Cater
Subject: gnue/gnuef/src GFForm.py GFObjects/GFBlock.py G...
Date: Thu, 19 Jul 2001 19:18:00 -0700

CVSROOT:        /home/cvs
Module name:    gnue
Branch:         gnuef-new-datasources
Changes by:     Jason Cater <address@hidden>    01/07/19 19:18:00

Modified files:
        gnuef/src      : GFForm.py 
        gnuef/src/GFObjects: GFBlock.py GFDataSource.py GFObj.py 

Log message:
        changing GFBlocks over to use ResultSets; committing to synch machines 
[broken cvs\!]

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFForm.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.110.2.6&tr2=1.110.2.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFBlock.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.4.2.5&tr2=1.4.2.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFDataSource.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.3.2.4&tr2=1.3.2.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFObj.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.2.2.1&tr2=1.2.2.2&r1=text&r2=text

Patches:
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.112 gnue/gnuef/src/GFForm.py:1.113
--- gnue/gnuef/src/GFForm.py:1.112      Thu Jul 12 20:56:13 2001
+++ gnue/gnuef/src/GFForm.py    Mon Jul 16 20:09:41 2001
@@ -783,6 +783,16 @@
             return message
     self._currentBlock.nextRecord()
 
+  def jumpRecord(self,count):
+    for block in self._blockList:
+      if hasattr(block,'master'):
+        masterBlock,masterField = string.split(block.master,'.')
+        if masterBlock == self._currentBlock.name:
+          if not block.isSaved():
+            message = GConfig.get('_msgNOTSAVED')
+            return message
+    self._currentBlock.jumpRecord(count)
+
 
   def toggleInsertMode(self):
     self._insertMode = not self._insertMode
Index: gnue/gnuef/src/GFObjects/GFBlock.py
diff -u gnue/gnuef/src/GFObjects/GFBlock.py:1.5 
gnue/gnuef/src/GFObjects/GFBlock.py:1.6
--- gnue/gnuef/src/GFObjects/GFBlock.py:1.5     Mon Jul 16 20:09:41 2001
+++ gnue/gnuef/src/GFObjects/GFBlock.py Wed Jul 18 15:45:01 2001
@@ -31,8 +31,7 @@
 # Copyright (c) 2000 Free Software Foundation
 #
 
-from gnue.common.GObjects import * 
-from gnue.common.dbdrivers.factory import factory
+#from gnue.common.GObjects import * 
 from gnue.forms.GFEvent import *
 from gnue.forms.GFObjects.GFDataSource import GFDataSource
 
@@ -41,7 +40,6 @@
 from GFObj import GFObj
 
 import string
-import types
 
 # These should really go somewhere else
 TRUE = 1
Index: gnue/gnuef/src/GFObjects/GFDataSource.py
diff -u gnue/gnuef/src/GFObjects/GFDataSource.py:1.3 
gnue/gnuef/src/GFObjects/GFDataSource.py:1.4
--- gnue/gnuef/src/GFObjects/GFDataSource.py:1.3        Wed Jul 11 16:06:46 2001
+++ gnue/gnuef/src/GFObjects/GFDataSource.py    Tue Jul 17 06:43:09 2001
@@ -188,31 +188,23 @@
   def commit(self):
     if hasattr(self,'database'):
       for count in range(len(self.resultSet)):
-        GDebug.printMesg(2, "record %s is %s \n %s" % (count, 
self.resultSetStatus[count],self.resultSet[count]))
-        mask = {}
-        for key in self.resultSet[count].keys():
-          if key in self.dataConnection.getFieldList(self.table).keys() or \
-             key == self.uniqueKey:
-            mask[key]=self.resultSet[count][key]
+        if self.resultSetStatus[count] in ('modified', 'deleted'):
+          GDebug.printMesg(2, "record %s is %s \n %s" % (count, 
self.resultSetStatus[count],self.resultSet[count]))
+          mask = {}
+          for key in self.resultSet[count].keys():
+            if key in self.dataConnection.getFieldList(self.table).keys() or \
+               key == self.uniqueKey:
+              mask[key]=self.resultSet[count][key]
 
-        GDebug.printMesg(10, "will be passing\n%s"% mask)
+          GDebug.printMesg(10, "will be passing\n%s"% mask)
                                                   
-        if self.resultSetStatus[count] in ('modified', 'deleted'):
           if self.resultSet[count].has_key(self.uniqueKey):
             if self.resultSetStatus[count]  == 'modified':
-              # record never in database so just mark for cleanup
-              # self.resultSet[count][self.uniqueKey] = -1
-              
-              # elif self.resultSet[count][self.uniqueKey] > 0:
               GDebug.printMesg(1, "updating the record")
               self.dataConnection.update(self.table,mask)
             else:
               GDebug.printMesg(1,"deleting the record")
-              #mask[self.uniqueKey] = \
-              #  mask[self.uniqueKey] * -1
               self.dataConnection.delete(self.table,mask)
-              # flip negative again so upcomming list purge see's the negatives
-              #mask[self.uniqueKey] = -1
               
           else:
             GDebug.printMesg(1, "Inserting the record")
Index: gnue/gnuef/src/GFObjects/GFObj.py
diff -u gnue/gnuef/src/GFObjects/GFObj.py:1.2 
gnue/gnuef/src/GFObjects/GFObj.py:1.3
--- gnue/gnuef/src/GFObjects/GFObj.py:1.2       Tue Jul  3 17:54:41 2001
+++ gnue/gnuef/src/GFObjects/GFObj.py   Wed Jul 18 15:45:01 2001
@@ -31,17 +31,9 @@
 # Copyright (c) 2000 Free Software Foundation
 #
 
-from gnue.common import GDebug
-from gnue.common import GConfig
-from gnue.common.GObjects import * 
-
+from gnue.common.GObjects import GObj
 from gnue.forms.GFTrigger import GFTriggerAware
 
-
-# These should really go somewhere else
-TRUE = 1
-FALSE = 0
-
 #
 # Class GFObj
 #
@@ -57,7 +49,6 @@
     self._visibleIndex = 0
     self.name = "__%s__" % self
 
-
   #
   # get an Option 
   #
@@ -70,7 +61,6 @@
             if o.name == name:
               option = o.value
     return option
-           
 
   #
   # recalculateVisible



reply via email to

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