dabo Commit
Revision 6991
Date: 2011-11-29 14:14:39 -0800 (Tue, 29 Nov 2011)
Author: Paul
Trac: http://trac.dabodev.com/changeset/6991
Changed:
U trunk/dabo/biz/dBizobj.py
Log:
Added getChangedStatus(), which returns the information in getRecordStatus(),
but for all the changed rows in the bizobj, including changed child bizobjs.
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2011-11-29 21:47:20 UTC (rev 6990)
+++ trunk/dabo/biz/dBizobj.py 2011-11-29 22:14:39 UTC (rev 6991)
@@ -748,6 +748,27 @@
return self._CurrentCursor.getRecordStatus(rownum)
+ def getChangedStatus(self, ret=None):
+ """
+ Returns a dictionary of bizobj references and the results of
+ getRecordStatus() on each changed row. Use to easily inspect
+ the current dirty records in the hierarchy.
+ """
+ if not ret:
+ ret = {}
+ ret[self] = []
+ changed_rows = self.getChangedRows()
+ for changed_row in changed_rows:
+ stat = self.getRecordStatus(rownum=changed_row)
+ if stat:
+ ret[self].append((changed_row, stat))
+ for child in self._children:
+ ret = child.getChangedStatus(ret)
+ if not ret[self]:
+ del(ret[self])
+ return ret
+
+
def bizIterator(self, reversed=False, restorePointer=False):
"""
Returns an iterator that moves the bizobj's record pointer from
_______________________________________________
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]