dabo Commit
Revision 5408
Date: 2009-09-22 14:31:27 -0700 (Tue, 22 Sep 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5408
Changed:
U trunk/dabo/db/dCursorMixin.py
Log:
Fix to cursor.cancel(allRows=True) which had a bug in canceling new records.
Thanks Jacek Kalucki for this, in ticket #1264.
Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2009-09-21 22:20:11 UTC (rev 5407)
+++ trunk/dabo/db/dCursorMixin.py 2009-09-22 21:31:27 UTC (rev 5408)
@@ -788,7 +788,7 @@
def getPK(self):
""" Returns the value of the PK field in the current record. If
that record
- is new an unsaved record, return the temp PK value. If this is
a compound
+ is a new unsaved record, return the temp PK value. If this is a
compound
PK, return a tuple containing each field's values.
"""
ret = None
@@ -796,7 +796,7 @@
raise dException.NoRecordsException(
_("No records in the data set."))
rec = self._records[self.RowNumber]
- recKey = self.pkExpression()
+ recKey = self.pkExpression(rec)
if (recKey in self._newRecords) and self.AutoPopulatePK:
# New, unsaved record
ret = rec[kons.CURSOR_TMPKEY_FIELD]
@@ -1460,6 +1460,7 @@
rec.pop(kons.CURSOR_TMPKEY_FIELD, None)
+
def getDataDiff(self, allRows=False):
"""Create a compact representation of all the modified records
for this cursor.
@@ -1545,7 +1546,7 @@
for idx in delrecs_idx:
del recs[idx]
self._newRecords = {}
- recs = dDataSet(recs)
+ self._records = dDataSet(recs)
if self.RowNumber >= self.RowCount:
self.RowNumber = self.RowCount - 1
_______________________________________________
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]