dabo Commit
Revision 5184
Date: 2009-04-20 20:17:32 -0700 (Mon, 20 Apr 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5184

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

Log:
Handled the case where there is a composite key but no records in the cursor's 
dataset.


Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py       2009-04-20 19:20:06 UTC (rev 5183)
+++ trunk/dabo/db/dCursorMixin.py       2009-04-21 03:17:32 UTC (rev 5184)
@@ -169,7 +169,10 @@
                        except IndexError:
                                rec = {}
                if isinstance(self.KeyField, tuple):
-                       pk = tuple([rec[kk] for kk in self.KeyField])
+                       if rec:
+                               pk = tuple([rec[kk] for kk in self.KeyField])
+                       else:
+                               pk = tuple([None for kk in self.KeyField])
                else:
                        pk = rec.get(self.KeyField, None)
                return pk



_______________________________________________
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