commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7951 - trunk/gnue-common/src/datasources/drivers/Base


From: reinhard
Subject: [gnue] r7951 - trunk/gnue-common/src/datasources/drivers/Base
Date: Wed, 28 Sep 2005 12:35:31 -0500 (CDT)

Author: reinhard
Date: 2005-09-21 10:37:49 -0500 (Wed, 21 Sep 2005)
New Revision: 7951

Modified:
   trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
Log:
Display records that have been inserted and then deleted as pending so the user
has the chance to hit "save" to get rid of them.


Modified: trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-09-21 
15:30:33 UTC (rev 7950)
+++ trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-09-21 
15:37:49 UTC (rev 7951)
@@ -475,12 +475,14 @@
     post it to the database.
 
     The result is True if either isInserted, isModified, or isDeleted is True.
+
+    If the record is void (i.e. has been inserted and then deleted again),
+    isPending also returns True even though no changes will be written to the
+    backend.
     """
     # ... but we check status fields instead of isXxxx to not have to evaluate
     # __hasPendingChildren several times.
-    return ((self.__modified or self.__hasPendingChildren ()) \
-            and not self.__deleted) \
-        or (not self.__inserted and self.__deleted)
+    return (self.__modified or self.__hasPendingChildren ()) or self.__deleted
 
   # ---------------------------------------------------------------------------
 
@@ -592,7 +594,7 @@
     """
 
     # Just to make sure - you never know who calls us...
-    if not self.isPending ():
+    if not self.isPending () or self.isVoid ():
       return
 
     # Call the hooks for commit-level hooks

Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-09-21 
15:30:33 UTC (rev 7950)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-09-21 
15:37:49 UTC (rev 7951)
@@ -642,7 +642,7 @@
       self.__currentRecord = 0
       while self.__currentRecord < len (self.__cachedRecords):
         self.current = self.__cachedRecords [self.__currentRecord]
-        if self.current.isPending ():
+        if self.current.isPending () and not self.current.isVoid ():
 
           # activate all matching detail resultsets so that committ triggers
           # see the correct details





reply via email to

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