Changeset 5364

Show
Ignore:
Timestamp:
09/06/09 08:59:15 (2 years ago)
Author:
paul
Message:

Uncommented the lines that were commented in r5135, fixing #1251.

Pedro, please test to see if this messes up the filtering on VirtualFields?,
but I don't see how it would.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/biz/dBizobj.py

    r5339 r5364  
    463463        and all new, unmodified records. 
    464464        """ 
    465         return self.cancel(ignoreNoRecords=ignoreNoRecords, allRows=True) 
    466  
    467  
    468     def cancel(self, ignoreNoRecords=None, allRows=False): 
     465        self.scanChangedRows(self.cancel, allCursors=False, includeNewUnchanged=True, 
     466                ignoreNoRecords=ignoreNoRecords) 
     467 
     468 
     469    def cancel(self, ignoreNoRecords=None): 
    469470        """Cancel all changes to the current record and all children. 
    470471 
     
    481482            ignoreNoRecords = True 
    482483        # Tell the cursor and all children to cancel themselves: 
    483         self._CurrentCursor.cancel(ignoreNoRecords=ignoreNoRecords, allRows=allRows
     484        self._CurrentCursor.cancel(ignoreNoRecords=ignoreNoRecords
    484485        for child in self.__children: 
    485486            child.cancelAll(ignoreNoRecords=ignoreNoRecords) 
     
    994995            contains: expr in fld 
    995996        """ 
    996         #currPK = self.getPK() 
     997        currPK = self.getPK() 
    997998        if self.VirtualFields.has_key(fld): 
    998999            self.scan(self.scanVirtualFields, fld=fld, expr=expr, op=op, reverse=True) 
     
    10041005            self._CurrentCursor.filter(fld=fld, expr=expr, op=op) 
    10051006 
    1006         #try: 
    1007         # newPK = self.getPK() 
    1008         #except dException.NoRecordsException: 
    1009         # newPK = currPK 
    1010  
    1011         #if newPK != currPK: 
    1012         # try: 
    1013         #     self.moveToPK(currPK) 
    1014         # except dabo.dException.RowNotFoundException: 
     1007        try: 
     1008          newPK = self.getPK() 
     1009        except dException.NoRecordsException: 
     1010          newPK = currPK 
     1011 
     1012        if newPK != currPK: 
     1013          try: 
     1014              self.moveToPK(currPK) 
     1015          except dabo.dException.RowNotFoundException: 
    10151016                # The old row was filtered out of the dataset 
    1016         #     self.first() 
     1017              self.first() 
    10171018 
    10181019    def scanVirtualFields(self, fld, expr, op):