dabo Commit
Revision 6935
Date: 2011-10-27 07:00:38 -0700 (Thu, 27 Oct 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6935
Changed:
U trunk/dabo/biz/dBizobj.py
Log:
- Change order of condition checking by moving isAnyChanged() check first as
cheaper.
- Revert changes in isAnyChanged() method to recognize changes in all nodes
again.
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2011-10-26 23:56:11 UTC (rev 6934)
+++ trunk/dabo/biz/dBizobj.py 2011-10-27 14:00:38 UTC (rev 6935)
@@ -1427,7 +1427,7 @@
# both of those conditions out completely for
now, although that is most certainly
# wrong as well, but at least we are now
consistent in behavior between e.g. self.first()
# and self.RowNumber = 0.
- if updateChildren and not child.isAnyChanged()
and child.cacheExpired():
+ if updateChildren and child.cacheExpired() and
not child.isAnyChanged():
child.requery()
@@ -1498,6 +1498,7 @@
self.afterPointerMove()
return ret
+
def _isChanged(self, allRows, includeNewUnchanged, withChildren):
cursor = self._CurrentCursor
if cursor is None or cursor.RowCount == 0:
@@ -1512,15 +1513,19 @@
return True
return False
-
+
def isAnyChanged(self, includeNewUnchanged=None, withChildren=True):
"""
Return True if at least one record in the current record set
has been changed.
"""
- return self._isChanged(True, includeNewUnchanged, withChildren)
+ def _isThisChanged():
+ self.exitScan = self._isChanged(True,
includeNewUnchanged, withChildren)
+ return self.exitScan
+ return self.scan(_isThisChanged, scanRequeryChildren=False)
+
def isChanged(self, includeNewUnchanged=None, withChildren=True):
"""
Return True if data has changed in this bizobj and any children.
_______________________________________________
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]