[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7171 - trunk/gnue-common/src/datasources/drivers/Base
From: |
reinhard |
Subject: |
[gnue] r7171 - trunk/gnue-common/src/datasources/drivers/Base |
Date: |
Fri, 11 Mar 2005 12:15:49 -0600 (CST) |
Author: reinhard
Date: 2005-03-11 12:15:48 -0600 (Fri, 11 Mar 2005)
New Revision: 7171
Modified:
trunk/gnue-common/src/datasources/drivers/Base/Connection.py
Log:
Added basic placeholders for the requery feature.
Modified: trunk/gnue-common/src/datasources/drivers/Base/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/Connection.py
2005-03-11 17:33:00 UTC (rev 7170)
+++ trunk/gnue-common/src/datasources/drivers/Base/Connection.py
2005-03-11 18:15:48 UTC (rev 7171)
@@ -145,7 +145,7 @@
@param table: Table name.
@param oldfields: Fieldname/Value dictionary of fields to find the existing
- record (aka where-clause)
+ record (aka where-clause).
@param newfields: Fieldname/Value dictionary of data to change.
@param recno: Record number to be used in error messages.
"""
@@ -164,7 +164,7 @@
@param table: Table name.
@param oldfields: Fieldname/Value dictionary of fields to find the existing
- record (aka where-clause)
+ record (aka where-clause).
@param recno: Record number to be used in error messages.
"""
@@ -173,6 +173,29 @@
gLeave (8)
# ---------------------------------------------------------------------------
+ # Requery an existing record to reflect changes done by the backend
+ # ---------------------------------------------------------------------------
+
+ def requery (self, table, oldfields, fields):
+ """
+ Requery an existing record to reflect changes done by the backend.
+
+ The returned dictionary is I{not} guaranteed to hold all field given in the
+ fields list (especially for drivers that don't implement this feature).
+ Callers should update() their current field dictionary with the result of
+ this function.
+
+ @param table: Table name.
+ @param oldfields: Fieldname/Value dictionary of fields to find the existing
+ record (aka where-clause).
+ @param fields: List of field names to query.
+ @return: Fieldname/Value dictionary with data fresh from the backend.
+ """
+
+ gEnter (8)
+ gLeave (8, self._requery (table, oldfields, fields))
+
+ # ---------------------------------------------------------------------------
# Commit pending changes in the backend
# ---------------------------------------------------------------------------
@@ -469,6 +492,25 @@
# ---------------------------------------------------------------------------
+ def requery (self, table, oldfields, fields):
+ """
+ Requery an existing record to reflect changes done by the backend (to be
+ implemented by descendants).
+
+ This method can be overwritten by descendants to return current data that
+ might have changed automatically by the backend (e.g. through database
+ triggers or appserver triggers) after an insert or update has been issued.
+
+ @param table: Table name.
+ @param oldfields: Fieldname/Value dictionary of fields to find the existing
+ record (aka where-clause).
+ @param fields: List of field names to query.
+ @return: Fieldname/Value dictionary with data fresh from the backend.
+ """
+ return {}
+
+ # ---------------------------------------------------------------------------
+
def _commit (self):
"""
Commit pending changes in the backend (to be implemented by descendants).
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7171 - trunk/gnue-common/src/datasources/drivers/Base,
reinhard <=