dabo Commit
Revision 6592
Date: 2011-05-25 00:50:37 -0700 (Wed, 25 May 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6592

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

Log:
Miscellaneous minor changes:
- added some verbosity to the RowNotFoundException exception
- remove redundant code in the setCurrentParent method
- added the Connection property.

Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py   2011-05-24 16:39:03 UTC (rev 6591)
+++ trunk/dabo/biz/dBizobj.py   2011-05-25 07:50:37 UTC (rev 6592)
@@ -186,8 +186,9 @@
                executing.
                """
                if self.__cursors:
-                       _dataStructure = 
getattr(self.__cursors[self.__cursors.keys()[0]], "_dataStructure", None)
-                       self._virtualFields = 
getattr(self.__cursors[self.__cursors.keys()[0]], "_virtualFields", {})
+                       cursorKey = self.__cursors.keys()[0]
+                       _dataStructure = getattr(self.__cursors[cursorKey], 
"_dataStructure", None)
+                       self._virtualFields = 
getattr(self.__cursors[cursorKey], "_virtualFields", {})
                else:
                        # The first cursor is being created, before 
DataStructure is assigned.
                        _dataStructure = None
@@ -1382,7 +1383,8 @@
                                runRequery=True)
                if row == -1:
                        # Need to use ustr(pk) because pk might be a tuple.
-                       raise dabo.dException.RowNotFoundException, _("PK Value 
'%s' not found in the dataset") % ustr(pk)
+                       raise dabo.dException.RowNotFoundException(
+                                       _("PK Value '%s' not found in the 
dataset of '%s'") % (ustr(pk), self.Name))
 
 
        def hasPK(self, pk):
@@ -1582,8 +1584,6 @@
                if self.LinkField:
                        if val is None:
                                val = self.getParentLinkValue()
-                       # Update the key value for the cursor
-                       self.__currentCursorKey = val
                        # Make sure there is a cursor object for this key.
                        self._CurrentCursor = val
                        if _oldKey != val:
@@ -2657,6 +2657,9 @@
                        subsequent requery request will be ignored.  (int)
                        """))
 
+       Connection = property(_getConnection, None, None,
+                       _("The dConnection object used to connect with the 
backend database."))
+
        CurrentSQL = property(_getCurrentSQL, None, None,
                        _("Returns the current SQL that will be run, which is 
one of UserSQL or AutoSQL."))
 



_______________________________________________
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