dabo Commit
Revision 5177
Date: 2009-04-12 14:15:39 -0700 (Sun, 12 Apr 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5177

Changed:
U   trunk/dabo/biz/dBizobj.py
U   trunk/dabo/db/dCursorMixin.py

Log:
Fixed a problem with PK expressions not being properly set on child requeries 
when using compound PKs, reported by Sibylle Koczian.


Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py   2009-04-08 22:10:54 UTC (rev 5176)
+++ trunk/dabo/biz/dBizobj.py   2009-04-12 21:15:39 UTC (rev 5177)
@@ -946,10 +946,12 @@
                ret = None
                if self.Parent:
                        fld = self.ParentLinkField
-                       if not fld:
-                               fld = self.Parent.KeyField
                        try:
-                               ret = self.Parent.getFieldVal(fld)
+                               if not fld:
+                                       # Use the PK value
+                                       ret = self.getParentPK()
+                               else:
+                                       ret = self.Parent.getFieldVal(fld)
                        except dException.NoRecordsException:
                                ret = NO_RECORDS_PK
                return ret
@@ -1453,7 +1455,7 @@
                        raise dException.dException(
                                        _("No key field defined for table: ") + 
self.DataSource)
                cc = self._CurrentCursor
-               return cc.getFieldVal(self.KeyField)
+               return cc.pkExpression()
 
 
        def getParentPK(self):

Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py       2009-04-08 22:10:54 UTC (rev 5176)
+++ trunk/dabo/db/dCursorMixin.py       2009-04-12 21:15:39 UTC (rev 5177)
@@ -186,7 +186,6 @@
                return pkField
 
 
-
        def _correctFieldType(self, field_val, field_name, _newQuery=False):
                """Correct the type of the passed field_val, based on 
self.DataStructure.
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to