commit-gnue
[Top][All Lists]
Advanced

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

gnue common/src/GDataObjects.py common/src/GDat...


From: Jason Cater
Subject: gnue common/src/GDataObjects.py common/src/GDat...
Date: Mon, 11 Feb 2002 11:44:01 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/02/11 11:43:59

Modified files:
        common/src     : GDataObjects.py GDataSource.py 
        forms/src/GFObjects: GFBlock.py 

Log message:
        addition of clear() method to blocks (for use in triggers)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GDataObjects.py.diff?tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GDataSource.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFObjects/GFBlock.py.diff?tr1=1.34&tr2=1.35&r1=text&r2=text

Patches:
Index: gnue/common/src/GDataObjects.py
diff -c gnue/common/src/GDataObjects.py:1.39 
gnue/common/src/GDataObjects.py:1.40
*** gnue/common/src/GDataObjects.py:1.39        Tue Jan 22 23:08:46 2002
--- gnue/common/src/GDataObjects.py     Mon Feb 11 11:43:59 2002
***************
*** 97,103 ****
      self._dataConnection = None
      self._resultSetClass = ResultSet
      self._fieldReferences = {}  # Set by GDataSource; lists all fields
!                                 # a client explicits references
  
      self._unboundFieldReferences = {}  # Contains names of all unbound
                                         # field references
--- 97,103 ----
      self._dataConnection = None
      self._resultSetClass = ResultSet
      self._fieldReferences = {}  # Set by GDataSource; lists all fields
!                                 # a client explicitly references
  
      self._unboundFieldReferences = {}  # Contains names of all unbound
                                         # field references
***************
*** 248,254 ****
      # it may contain uncommitted changes)
      if (not master.current._cachedDetailResultSets.has_key(self)) or \
          ( not int(GConfig.get('CacheDetailRecords','1')) and \
!         not master.current._cachedDetailResultSets[self].isPending() ):
        for i in range(0, len(self._masterfields)):
          GDebug.printMesg(10,"Adding criteria")
          criteria[string.strip(self._detailfields[i])] = \
--- 248,254 ----
      # it may contain uncommitted changes)
      if (not master.current._cachedDetailResultSets.has_key(self)) or \
          ( not int(GConfig.get('CacheDetailRecords','1')) and \
!           not master.current._cachedDetailResultSets[self].isPending() ):
        for i in range(0, len(self._masterfields)):
          GDebug.printMesg(10,"Adding criteria")
          criteria[string.strip(self._detailfields[i])] = \
***************
*** 333,339 ****
        self.current = self._cachedRecords[self._currentRecord]
        self.notifyDetailObjects()
        return 1
!       
    # returns 1=New record loaded, 0=No more records
    def nextRecord(self):
      if self._currentRecord + 1 == len(self._cachedRecords):
--- 333,339 ----
        self.current = self._cachedRecords[self._currentRecord]
        self.notifyDetailObjects()
        return 1
! 
    # returns 1=New record loaded, 0=No more records
    def nextRecord(self):
      if self._currentRecord + 1 == len(self._cachedRecords):
Index: gnue/common/src/GDataSource.py
diff -c gnue/common/src/GDataSource.py:1.25 gnue/common/src/GDataSource.py:1.26
*** gnue/common/src/GDataSource.py:1.25 Tue Feb  5 00:45:53 2002
--- gnue/common/src/GDataSource.py      Mon Feb 11 11:43:59 2002
***************
*** 68,74 ****
                                
'simpleQuery':{'function':self.triggerSimpleQuery,
                                               },
                                }
!                 
  
    def triggerSimpleQuery(self,maskDict):
      queryDict = {}
--- 68,74 ----
                                
'simpleQuery':{'function':self.triggerSimpleQuery,
                                               },
                                }
! 
  
    def triggerSimpleQuery(self,maskDict):
      queryDict = {}
***************
*** 170,177 ****
    def addDetailDataObject(self, dataObject, handler=None):
        self._dataObject.addDetailDataObject(dataObject, handler)
  
!   def createEmptyResultSet(self, readOnly=0):
!       return self._dataObject.createEmptyResultSet(readOnly)
  
  ######
  #
--- 170,177 ----
    def addDetailDataObject(self, dataObject, handler=None):
        self._dataObject.addDetailDataObject(dataObject, handler)
  
!   def createEmptyResultSet(self, readOnly=0,masterRecordSet=None):
!       return self._dataObject.createEmptyResultSet(readOnly,masterRecordSet)
  
  ######
  #
Index: gnue/forms/src/GFObjects/GFBlock.py
diff -c gnue/forms/src/GFObjects/GFBlock.py:1.34 
gnue/forms/src/GFObjects/GFBlock.py:1.35
*** gnue/forms/src/GFObjects/GFBlock.py:1.34    Sun Feb 10 20:13:18 2002
--- gnue/forms/src/GFObjects/GFBlock.py Mon Feb 11 11:43:59 2002
***************
*** 3,13 ****
  #
  # GNU Enterprise is free software; you can redistribute it 
  # and/or modify it under the terms of the GNU General Public 
! # License as published by the Free Software Foundation; either 
  # version 2, or (at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be 
! # useful, but WITHOUT ANY WARRANTY; without even the implied 
  # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  # PURPOSE. See the GNU General Public License for more details.
  #
--- 3,13 ----
  #
  # GNU Enterprise is free software; you can redistribute it 
  # and/or modify it under the terms of the GNU General Public 
! # License as published by the Free Software Foundation; either
  # version 2, or (at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be
! # useful, but WITHOUT ANY WARRANTY; without even the implied
  # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  # PURPOSE. See the GNU General Public License for more details.
  #
***************
*** 76,82 ****
      #
      self._triggerGlobal = 1
      
self._triggerFunctions={'autofillBySequence':{'function':self.triggerAutofillBySequence},
!                             'rollback':{'function':self.processRollback},
                              'gotoRecord':{'function':self.jumpRecord},
                              'newRecord':{'function':self.newRecord},
                              }
--- 76,82 ----
      #
      self._triggerGlobal = 1
      
self._triggerFunctions={'autofillBySequence':{'function':self.triggerAutofillBySequence},
!                             'clear':{'function':self.processClear},
                              'gotoRecord':{'function':self.jumpRecord},
                              'newRecord':{'function':self.newRecord},
                              }
***************
*** 267,279 ****
  
      self.mode='normal'
  
    #
    # processRollback
    #
    # if recovering=0, then the user requested a rollback
    # if recovering=1, then a commit or such failed and we need to clean up
    # (but not lose state information)
!   # 
    def processRollback(self, recovering=0):
      #self.mode='normal'
      if not recovering:
--- 267,294 ----
  
      self.mode='normal'
  
+ 
+   #
+   # processClear
+   #
+   def processClear(self):
+     self._dataSourceLink._dataObject.rollback()
+     if not self._dataSourceLink.hasMaster():
+       self._dataSourceLink.createEmptyResultSet()
+     else:
+       
self._dataSourceLink.createEmptyResultSet(self._resultSet._masterRecordSet)
+     self._currentRecord = 0
+     self._recordCount = 0
+     self.switchRecord(0)
+ 
+ 
    #
    # processRollback
    #
    # if recovering=0, then the user requested a rollback
    # if recovering=1, then a commit or such failed and we need to clean up
    # (but not lose state information)
!   #
    def processRollback(self, recovering=0):
      #self.mode='normal'
      if not recovering:



reply via email to

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