[gnue] r10184 - in trunk/gnue-common: . src/datasources

[email protected] Tue, 25 May 2010 05:12:34 -0500 (CDT)
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: reinhard
Date: 2010-05-25 05:12:33 -0500 (Tue, 25 May 2010)
New Revision: 10184

Modified:
   trunk/gnue-common/
   trunk/gnue-common/src/datasources/GDataSource.py
Log:
Don't use the rowid field at all for datasources where the table is a join.
This fixes a bug in the commit of master-detail datasources where the master is
a join.



Property changes on: trunk/gnue-common
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-05-19 17:15:45.028000116 +0200
committer: Reinhard Müller <[email protected]>
properties: 
	branch-nick: common

   + timestamp: 2010-05-25 12:10:23.839999914 +0200
committer: Reinhard Müller <[email protected]>
properties: 
	branch-nick: common

Name: bzr:file-ids
   - src/base/errors.py	9803@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fbase%2Ferrors.py

   + src/datasources/GDataSource.py	1098@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FGDataSource.py

Name: bzr:revision-id:v4
   - 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]

   + 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]
3123 [email protected]

Name: bzr:text-parents
   - src/base/errors.py	[email protected]

   + src/datasources/GDataSource.py	svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9986


Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py	2010-05-19 15:17:14 UTC (rev 10183)
+++ trunk/gnue-common/src/datasources/GDataSource.py	2010-05-25 10:12:33 UTC (rev 10184)
@@ -310,13 +310,15 @@
       self.__resultSetClass = self._connection._resultSetClass_
       
       # Check if the connection has a fixed primary key name
-      primarykeyFields = self._connection._primarykeyFields_
-      if primarykeyFields:
-        self.__primarykeyFields = primarykeyFields
+      if self._connection._primarykeyFields_:
+        self.__primarykeyFields = self._connection._primarykeyFields_
 
-      rowidField = self._connection._rowidField_ or self.__exp_rowid
-      if rowidField:
-        self.__rowidField = rowidField
+      if self.type == 'object':
+          # We can't use the standard rowid field for joins.
+          if self._connection._rowidField_ and self.table.find(' ') == -1:
+              self.__rowidField = self._connection._rowidField_
+          elif self.__exp_rowid:
+              self.__rowidField = self.__exp_rowid
 
     # Add ourselves into the "global" datasource dictionary
     self._topObject._datasourceDictionary [self.name.lower ()] = self