Changeset 3029
- Timestamp:
- 04/04/07 17:14:16 (2 years ago)
- Files:
-
- trunk/dabo/biz/dBizobj.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/biz/dBizobj.py
r3028 r3029 923 923 924 924 925 def isAnyChanged(self, _topLevel=True):925 def isAnyChanged(self, parentPK=None): 926 926 """Returns True if any record in the current record set has been changed.""" 927 try: 928 cc = self._CurrentCursor 929 except: 930 cc = None 927 if parentPK is None: 928 try: 929 cc = self._CurrentCursor 930 except: 931 cc = None 932 else: 933 cc = self.__cursors.get(parentPK, None) 931 934 if cc is None: 932 935 # No cursor, no changes. 933 936 return False 934 if _topLevel: 935 # Only check the _CurrentCursor: 936 if self._CurrentCursor.isChanged(allRows=True): 937 return True 938 else: 939 # Need to check all cached cursors: 940 for cursor in self.__cursors.values(): 941 if cursor.isChanged(allRows=True): 942 return True 937 938 if cc.isChanged(allRows=True): 939 return True 943 940 944 941 # Nothing's changed in the top level, so we need to recurse the children: 942 try: 943 pk = self.getPK() 944 except dException.NoRecordsException: 945 # If there are no records, there can be no changes 946 return False 947 945 948 for child in self.__children: 946 if child.isAnyChanged( _topLevel=False):949 if child.isAnyChanged(parentPK=pk): 947 950 return True 948 951 # If we made it to here, there are no changes. 949 952 return False 950 953 … … 967 970 if not ret: 968 971 # see if any child bizobjs have changed 972 try: 973 pk = self.getPK() 974 except dException.NoRecordsException: 975 # If there are no records, there can be no changes 976 return False 969 977 for child in self.__children: 970 ret = child.isAnyChanged( _topLevel=False)978 ret = child.isAnyChanged(parentPK=pk) 971 979 if ret: 972 980 break
