Author: reinhard Date: 2005-09-21 10:28:12 -0500 (Wed, 21 Sep 2005) New Revision: 7949
Modified: trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py Log: Fixes for records that have been inserted and then deleted. Modified: trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py =================================================================== --- trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-09-21 14:42:01 UTC (rev 7948) +++ trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-09-21 15:28:12 UTC (rev 7949) @@ -426,6 +426,14 @@ # --------------------------------------------------------------------------- + def isVoid (self): + """ + Return True if the record has been inserted and then deleted. + """ + return self.__inserted and self.__deleted + + # --------------------------------------------------------------------------- + def isInserted (self): """ Return True if the record has been newly inserted and has either changes @@ -495,7 +503,8 @@ happened has been committed. """ return (self.__requeryStatus == 'posted') \ - or (self.__requeryStatus == 'commit' and commit) + or (self.__requeryStatus == 'commit' and commit) \ + or self.isEmpty () or self.isVoid () # --------------------------------------------------------------------------- Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py =================================================================== --- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-09-21 14:42:01 UTC (rev 7948) +++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-09-21 15:28:12 UTC (rev 7949) @@ -692,7 +692,7 @@ while index < len (self.__cachedRecords): record = self.__cachedRecords [index] if record._needsRequery (commit): - if ((record.isEmpty () or record.isDeleted ()) \ + if ((record.isEmpty () or record.isVoid () or record.isDeleted ()) \ and self.__connection is not None): self.__removeRecord (index) else: @@ -800,7 +800,8 @@ if self.current and self.current != oldCurrent: # If the cursor moved out of an empty record, throw it away. if oldCurrent and oldCurrent.isEmpty (): - self.__removeRecord (self.__cachedRecords.index (oldCurrent)) + if oldCurrent in self.__cachedRecords: + self.__removeRecord (self.__cachedRecords.index (oldCurrent)) self.current._activate () if self.__eventController is not None: _______________________________________________ Commit-gnue mailing list Commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue