commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7240 - in trunk/gnue-common/src/datasources: . drivers/Base


From: reinhard
Subject: [gnue] r7240 - in trunk/gnue-common/src/datasources: . drivers/Base
Date: Mon, 21 Mar 2005 09:51:19 -0600 (CST)

Author: reinhard
Date: 2005-03-21 09:51:18 -0600 (Mon, 21 Mar 2005)
New Revision: 7240

Modified:
   trunk/gnue-common/src/datasources/GDataSource.py
   trunk/gnue-common/src/datasources/drivers/Base/Connection.py
Log:
Added support for fixed primary key name (for appserver).


Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2005-03-21 11:42:18 UTC 
(rev 7239)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2005-03-21 15:51:18 UTC 
(rev 7240)
@@ -261,6 +261,13 @@
          self._connections.getDataObject(self.connection, self.type)
       gDebug (7, "GDataSource.py bound to %s " % dataObject)
       
+      # Check if the connection has a fixed primary key name
+      primarykeyFields = dataObject._connection._primarykeyFields
+      if primarykeyFields:
+        self._primarykeyFields = primarykeyFields
+        for field in self._primarykeyFields:
+          self._fieldReferences [field] = True
+
       # Include the rowid in list of field references
       rowidField = dataObject._connection._rowidField
       if rowidField:

Modified: trunk/gnue-common/src/datasources/drivers/Base/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/Connection.py        
2005-03-21 11:42:18 UTC (rev 7239)
+++ trunk/gnue-common/src/datasources/drivers/Base/Connection.py        
2005-03-21 15:51:18 UTC (rev 7240)
@@ -47,6 +47,8 @@
     'object' or 'sql').  Must be overwritten by descendants.
   @cvar _rowidField: Field name of the rowid generated by the backend.  Can be
     overwritten by descendants if the backend supports rowids.
+  @cvar _primarykeyFields: Field names of the primary key.  Can be overwritten
+    by descendants if the backend has a fixed fieldname for the primary key.
 
   @ivar name: Name of the connection from connections.conf.
   @ivar parameters: Parameters from connections.conf.
@@ -59,6 +61,7 @@
   supportedDataObjects = {}
 
   _rowidField = None
+  _primarykeyFields = None
 
 
   # ---------------------------------------------------------------------------





reply via email to

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