commit-gnue
[Top][All Lists]
Advanced

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

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


From: reinhard
Subject: [gnue] r7200 - trunk/gnue-common/src/datasources/drivers/Base
Date: Mon, 14 Mar 2005 04:17:01 -0600 (CST)

Author: reinhard
Date: 2005-03-14 04:17:00 -0600 (Mon, 14 Mar 2005)
New Revision: 7200

Modified:
   trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
Log:
Removed obsolete _postXxx functions.


Modified: trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-03-14 
08:08:48 UTC (rev 7199)
+++ trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-03-14 
10:17:00 UTC (rev 7200)
@@ -422,19 +422,23 @@
   # Virtual methods to be overwritten by the drivers
   # ---------------------------------------------------------------------------
 
-  def _postChanges (self, recordNumber = None):
+  def _postChanges (self, recno = None):
     """
     Post any changes (deletes, inserts, and updates) to the database.
+
     Descendants can either override this function, or the three functions
-    _postDelete, _postInsert, and _postUpdate.
+    _insert, _update, and _delete of the Connection object (the latter is
+    recommended).
 
     _postChanges is guaranteed to be only called for records that have pending
     changes. Implementations of this function can check the kind of pending
     change by querying the _deleteFlag, _insertFlag, and _updateFlag instance
     variables.
     """
+    do = self._parent._dataObject
+
     if self._deleteFlag:
-      self._postDelete ()
+      do._connection.delete (do.table, self.__wherefields (), recno)
 
     elif self._insertFlag or self._updateFlag:
       modifiedFields = {}
@@ -443,60 +447,12 @@
           modifiedFields [field] = self._fields [field]
 
       if self._insertFlag:
-        self._postInsert (modifiedFields)
+        do._connection.insert (do.table, fields, recno)
       else:
-        self._postUpdate (modifiedFields)
+        do._connection.update (do.table, self.__wherefields (), fields, recno)
 
       # The record is now "clean" again
       self._insertFlag    = False
       self._updateFlag    = False
       self._modifiedFlags = {}
       self._initialData   = self._fields.copy ()
-
-  # ---------------------------------------------------------------------------
-
-  def _postInsert (self, fields):
-    """
-    Post an insert to the backend. Descendants should override this function
-    (or the general _postChanges function).
-
-    _postInsert is guaranteed to be only called for records that pend an
-    insert (i.e. that were newly created).
-
-    @param fields: a dictionary with field names as keys and field values as
-        values.
-    """
-    do = self._parent._dataObject
-    # FIXME: recno is missing
-    do._connection.insert (do.table, fields, 0)
-
-  # ---------------------------------------------------------------------------
-
-  def _postUpdate (self, fields):
-    """
-    Post an update to the backend. Descendants should override this function
-    (or the general _postChanges function).
-
-    _postUpdate is guaranteed to be only called for records that pend an
-    update (i.e. for existing records that were modified).
-
-    @param fields: a dictionary with field names as keys and field values as
-        values.
-    """
-    do = self._parent._dataObject
-    # FIXME: recno is missing
-    do._connection.update (do.table, self.__wherefields (), fields, 0)
-
-  # ---------------------------------------------------------------------------
-
-  def _postDelete (self):
-    """
-    Post a deletion to the backend. Descendants should override this function
-    (or the general _postChanges function).
-
-    _postDelete is guaranteed to be only called for records that pend a
-    deletion.
-    """
-    do = self._parent._dataObject
-    # FIXME: recno is missing
-    do._connection.delete (do.table, self.__wherefields (), 0)





reply via email to

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