[Mpuls-commits] r4050 - base/trunk/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 27 19:16:46 CEST 2010


Author: torsten
Date: 2010-10-27 19:16:44 +0200 (Wed, 27 Oct 2010)
New Revision: 4050

Modified:
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (MpulsCase.setPhase), (MpulsCase.getPhase):
Added convinience function to get und set the phase of a case. Further
the set function now automatically checks the validity of the case
after setting the phase.


Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2010-10-27 17:07:13 UTC (rev 4049)
+++ base/trunk/mpulsweb/model/case.py	2010-10-27 17:16:44 UTC (rev 4050)
@@ -858,6 +858,16 @@
         self.formed_instance.setData(data)
         self.formed_instance.commit()
 
+    def getPhase(self):
+        return self.getState().getPhase()
+
+    def setPhase(self, phase):
+        r = self.getState().setPhase(phase)
+        if g.mpuls_config.is_enabled ('case-module', 'checktags'):
+            log.debug('Checking validity because of phase change')
+            self.checkValidity()
+        return r
+
     def getState(self):
         return self.state
 



More information about the Mpuls-commits mailing list