dabo Commit
Revision 7080
Date: 2012-02-06 14:11:57 -0800 (Mon, 06 Feb 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7080
Changed:
U trunk/dabo/biz/dBizobj.py
Log:
Add biz.removeAllChildren()
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2012-02-06 19:32:02 UTC (rev 7079)
+++ trunk/dabo/biz/dBizobj.py 2012-02-06 22:11:57 UTC (rev 7080)
@@ -1711,15 +1711,23 @@
"""
Add the passed child bizobj to this bizobj.
- During the creation of the form, child bizobjs are added by the
parent.
- This stores the child reference here, and sets the reference to
the
- parent in the child.
+ Child bizobjs stay in sync with their parent, getting requeried
at the
+ appropriate times.
"""
if child not in self._children:
self._children.append(child)
child.Parent = self
+ def removeAllChildren(self):
+ """
+ Remove all child bizobjs.
+ """
+ while self._children:
+ child = self._children.pop()
+ child.Parent = None
+
+
def addMMBizobj(self, mmBizobj, assocTable, assocPKColThis,
assocPKColOther,
mmPkCol=None):
"""
@@ -2766,7 +2774,7 @@
return None
def _setParent(self, val):
- if isinstance(val, dBizobj):
+ if val is None or isinstance(val, dBizobj):
self._parent = val
else:
raise TypeError(_("Parent must descend from dBizobj"))
_______________________________________________
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]