dabo Commit
Revision 6887
Date: 2011-10-06 11:36:37 -0700 (Thu, 06 Oct 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6887

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

Log:
Added convenience function getFieldVals(), which just decorates input
and output to/from getDataSet() to return the dict of field/value
pairs in the current or specified row.


Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py   2011-10-04 21:43:01 UTC (rev 6886)
+++ trunk/dabo/biz/dBizobj.py   2011-10-06 18:36:37 UTC (rev 6887)
@@ -1827,6 +1827,16 @@
                return ret
 
 
+       def getFieldVals(self, row=None):
+               """Return a dict of the field/value pairs in the current or 
specified row."""
+               if row is None:
+                       row = self.RowNumber
+               ret = self.getDataSet(rowStart=row, rows=1)
+               if not ret:
+                       return {}
+               return ret[0]
+
+
        def setFieldVal(self, fld, val, row=None, pk=None):
                """Set the value of the specified field in the current or 
specified row."""
                changed = self._CurrentCursor.setFieldVal(fld, val, row, 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