dabo Commit
Revision 5049
Date: 2009-02-08 18:29:03 -0800 (Sun, 08 Feb 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5049
Changed:
U trunk/dabo/biz/dBizobj.py
U trunk/dabo/lib/RemoteConnector.py
Log:
These are the client-side changes that allow for correct parent-child data
saving.
Diff:
Modified: trunk/dabo/biz/dBizobj.py
===================================================================
--- trunk/dabo/biz/dBizobj.py 2009-02-09 02:25:03 UTC (rev 5048)
+++ trunk/dabo/biz/dBizobj.py 2009-02-09 02:29:03 UTC (rev 5049)
@@ -617,12 +617,11 @@
added to the dict under the key 'children' so that they can be
processed
accordingly.
"""
- diff = {hash(self):
self._CurrentCursor.getDataDiff(allRows=allRows)}
- kids = []
+ myData = self._CurrentCursor.getDataDiff(allRows=allRows)
+ kids = {}
for child in self.__children:
- kids.append(child.getDataDiff(allRows=True))
- if kids:
- diff["children"] = kids
+ kids.update(child.getDataDiff(allRows=True))
+ diff = {hash(self): (self.DataSource, self.KeyField, myData,
kids)}
return diff
Modified: trunk/dabo/lib/RemoteConnector.py
===================================================================
--- trunk/dabo/lib/RemoteConnector.py 2009-02-09 02:25:03 UTC (rev 5048)
+++ trunk/dabo/lib/RemoteConnector.py 2009-02-09 02:29:03 UTC (rev 5049)
@@ -109,8 +109,7 @@
def save(self, startTransaction=False, allRows=False):
biz = self.obj
url = self._getFullUrl("save")
- changes = biz.getDataDiff(allRows=allRows)
- chgDict = {hash(biz): (biz.DataSource, biz.KeyField, changes)}
+ chgDict = biz.getDataDiff(allRows=allRows)
params = {"DataDiff": jsonEncode(chgDict), "_method": "POST"}
prm = urllib.urlencode(params)
try:
_______________________________________________
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]