dabo Commit
Revision 5281
Date: 2009-06-29 13:37:48 -0700 (Mon, 29 Jun 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5281
Changed:
U trunk/dabo/db/dCursorMixin.py
Log:
Fixed the bug I talked about in the last commit: we were only removing the
memento
for the deleted record if the record also happened to be a new record. Mementos
for deleted records were thus sticking around, causing problems later on in
save() and cancel() routines.
Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2009-06-29 20:16:02 UTC (rev 5280)
+++ trunk/dabo/db/dCursorMixin.py 2009-06-29 20:37:48 UTC (rev 5281)
@@ -1590,8 +1590,6 @@
if pk in self._newRecords:
res = True
del self._newRecords[pk]
- if pk in self._mementos:
- del self._mementos[pk]
else:
pkWhere = self.makePkWhere()
# some backends(PostgreSQL) don't return information
about number of deleted rows
@@ -1604,12 +1602,13 @@
sql = "delete from %s where %s" % (self.Table,
pkWhere)
aux.execute(sql)
-
if not res:
# Nothing was deleted
self.BackendObject.noResultsOnDelete()
else:
# Delete the record from the current dataset
+ if pk in self._mementos:
+ del self._mementos[pk]
self._removeRow(delRowNum)
_______________________________________________
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]