commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7199 - in trunk: gnue-appserver/src gnue-common/src/datasources


From: reinhard
Subject: [gnue] r7199 - in trunk: gnue-appserver/src gnue-common/src/datasources
Date: Mon, 14 Mar 2005 02:08:49 -0600 (CST)

Author: reinhard
Date: 2005-03-14 02:08:48 -0600 (Mon, 14 Mar 2005)
New Revision: 7199

Modified:
   trunk/gnue-appserver/src/data.py
   trunk/gnue-common/src/datasources/GDataSource.py
Log:
Fixed primary key for appserver.


Modified: trunk/gnue-appserver/src/data.py
===================================================================
--- trunk/gnue-appserver/src/data.py    2005-03-14 07:42:58 UTC (rev 7198)
+++ trunk/gnue-appserver/src/data.py    2005-03-14 08:08:48 UTC (rev 7199)
@@ -464,6 +464,7 @@
 def _createDatasource (connections, database, content, order = None):
 
   # build table list, field list, and join condition
+  primarykey = u'gnue_id'
   master = []
   tables = []
   fields = []
@@ -472,6 +473,7 @@
     if alias:
       if not fk_alias:
         master.append ((None, table + ' ' + alias))
+        primarykey = alias + '.' + primarykey
       fields.extend ([alias + '.' + field for field in fieldlist])
     else:
       master.append ((None, table))
@@ -494,8 +496,9 @@
   attributes ['table']     = "%s %s" % \
       (string.join ([m [1] for m in master], ','),
        string.join ([t [1] for t in tables], ' '))
-  attributes ['primarykey'] = 'gnue_id'
 
+  attributes ['primarykey'] = primarykey
+
   # give the backend a hint that it's working for appserver :)
   datacon = connections.getConnection (database)
   datacon.parameters ['appserver'] = True

Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2005-03-14 07:42:58 UTC 
(rev 7198)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2005-03-14 08:08:48 UTC 
(rev 7199)
@@ -275,8 +275,6 @@
       pass
 
     # Make sure the primary key is included in the field references
-    # FIXME: reinhard, please check if the following lines. They break joins in
-    # appserver.
     if dataObject._primaryIdField:
       self._fieldReferences [dataObject._primaryIdField] = True
 





reply via email to

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