[Mpuls-commits] r5236 - in base/trunk: . mpulsweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Aug 17 18:18:33 CEST 2011
Author: bh
Date: 2011-08-17 18:18:32 +0200 (Wed, 17 Aug 2011)
New Revision: 5236
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MpulsCase.markDelete): New method to
mark the case for deletion. Derived classes may extend this
method.
(MpulsCaseBundle.markDelete): Call the new MpulsCase method
markDelete instead of setting the case's state directly.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2011-08-17 16:05:24 UTC (rev 5235)
+++ base/trunk/ChangeLog 2011-08-17 16:18:32 UTC (rev 5236)
@@ -1,5 +1,13 @@
2011-08-17 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/model/case.py (MpulsCase.markDelete): New method to
+ mark the case for deletion. Derived classes may extend this
+ method.
+ (MpulsCaseBundle.markDelete): Call the new MpulsCase method
+ markDelete instead of setting the case's state directly.
+
+2011-08-17 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/model/case.py (MpulsCase.markAnonymize): New method to
mark the case for anonymization. Derived classes may extend what
the method does.
Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py 2011-08-17 16:05:24 UTC (rev 5235)
+++ base/trunk/mpulsweb/model/case.py 2011-08-17 16:18:32 UTC (rev 5236)
@@ -414,8 +414,7 @@
for id in self.case_list:
case = factory.loadById(id)
try:
- state = case.getState()
- state.setState(3)
+ case.markDelete()
num += 1
except Exception, e:
log.exception(e)
@@ -993,6 +992,10 @@
self._load_formed_instance_tree()
factory.copy_instance_tree(self.formed_instance)
+ def markDelete(self):
+ """Mark case for deletion"""
+ self.getState().setState(3)
+
def delete(self):
"""Deletes the case from data base. Returns True if deletion succseeds
"""
More information about the Mpuls-commits
mailing list