dabo Commit
Revision 6367
Date: 2011-02-01 16:20:26 -0800 (Tue, 01 Feb 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6367
Changed:
U trunk/dabo/biz/dBizobj.py
U trunk/dabo/biz/test/test_dBizobj.py
Log:
Removed some try blocks from biz.get|setFieldVal, as I think the exceptions
should be raised for the appdev to know there's a problem.
Fixed up the test_Encoding() function of the biz test, which had been failing
for awhile.
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2011-02-01 23:17:27 UTC (rev 6366)
+++ trunk/dabo/biz/dBizobj.py 2011-02-02 00:20:26 UTC (rev 6367)
@@ -1639,10 +1639,7 @@
changeRowNumCallback = None
if cursor is not None:
- try:
- ret = cursor.getFieldVal(fld, row,
_rowChangeCallback=changeRowNumCallback)
- except dException.RowNotFoundException:
- return None
+ ret = cursor.getFieldVal(fld, row,
_rowChangeCallback=changeRowNumCallback)
if oldRow != self.RowNumber:
self._moveToRowNum(oldRow)
@@ -1652,14 +1649,10 @@
def setFieldVal(self, fld, val, row=None, pk=None):
"""Set the value of the specified field in the current or
specified row."""
cursor = self._CurrentCursor
- if cursor is None:
- return
- try:
- changed = cursor.setFieldVal(fld, val, row, pk)
- except (dException.NoRecordsException,
dException.RowNotFoundException):
- return False
+ changed = cursor.setFieldVal(fld, val, row, pk)
if changed:
self.afterSetFieldVal(fld, row)
+ return changed
def setFieldVals(self, valDict=None, row=None, pk=None, **kwargs):
Modified: trunk/dabo/biz/test/test_dBizobj.py
===================================================================
--- trunk/dabo/biz/test/test_dBizobj.py 2011-02-01 23:17:27 UTC (rev 6366)
+++ trunk/dabo/biz/test/test_dBizobj.py 2011-02-02 00:20:26 UTC (rev 6367)
@@ -103,7 +103,7 @@
def test_Encoding(self):
biz = self.biz
- self.assertEqual(biz.Encoding, "utf-8")
+ self.assertEqual(biz.Encoding, dabo.getEncoding())
biz.Encoding = "latin-1"
self.assertEqual(biz.Encoding, "latin-1")
_______________________________________________
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]