Changeset 3239
- Timestamp:
- 07/11/2007 09:31:27 PM (1 year ago)
- Files:
-
- trunk/dabo/biz/dBizobj.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/biz/dBizobj.py
r3210 r3239 8 8 import dabo.dException as dException 9 9 from dabo.dObject import dObject 10 11 12 NO_RECORDS_PK = "75426755-2f32-4d3d-86b6-9e2a1ec47f2c" ## Can't use None 10 13 11 14 … … 787 790 """ If this is a child bizobj, its record set is dependent on its parent's 788 791 current PK value. This will add the appropriate WHERE clause to 789 filter the child records. If the parent is a new, unsaved record, 790 there cannot be any child records saved yet, so an empty query791 is built.792 filter the child records. If the parent is a new, unsaved record, or if 793 there is no parent record, there cannot be any child records saved yet, 794 so an empty query is built. 792 795 """ 793 796 if self.DataSource and self.LinkField and self.Parent: 794 if self.Parent.IsAdding :797 if self.Parent.IsAdding or self.Parent.RowCount == 0: 795 798 # Parent is new and not yet saved, so we cannot have child records yet. 796 799 self.setWhereClause("") … … 1208 1211 pk = None 1209 1212 else: 1210 pk = self.getPK() 1213 try: 1214 pk = self.getPK() 1215 except dException.NoRecordsException: 1216 # There aren't any records, all children should requery to 0 records. 1217 # We can't set the pk to None, because None has special meaning 1218 # elsewhere (self.__currentCursorKey). 1219 pk = NO_RECORDS_PK 1220 1211 1221 for child in self.__children: 1212 1222 # Let the child know the current dependent PK
