[gnue] r9752 - trunk/gnue-common/src/datasources

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: reinhard
Date: 2007-07-12 08:42:27 -0500 (Thu, 12 Jul 2007)
New Revision: 9752

Modified:
   trunk/gnue-common/src/datasources/GDataSource.py
Log:
Don't traceback for master/detail when master does not have a current record.


Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py	2007-07-12 12:53:16 UTC (rev 9751)
+++ trunk/gnue-common/src/datasources/GDataSource.py	2007-07-12 13:42:27 UTC (rev 9752)
@@ -687,9 +687,10 @@
 
     # Merge the correct foreign key values into the default data dictionary
     defaultData = self.__defaultData.copy ()
-    for (masterfield, detailfield) in zip (
-        self.__masterPkFields, self.__masterFkFields):
-      defaultData [detailfield] = masterRecord.getField (masterfield)
+    if masterRecord is not None:
+      for (masterfield, detailfield) in zip (
+          self.__masterPkFields, self.__masterFkFields):
+        defaultData [detailfield] = masterRecord.getField (masterfield)
 
     # Create the ResultSet instance
     return self.__resultSetClass (
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.