[Mpuls-commits] r2590 - wasko/branches/2.0/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon May 3 12:52:21 CEST 2010


Author: torsten
Date: 2010-05-03 12:52:07 +0200 (Mon, 03 May 2010)
New Revision: 2590

Modified:
   wasko/branches/2.0/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py: Initiate CaseState object with the case phase
	when loading the caseoverview.



Modified: wasko/branches/2.0/mpulsweb/model/case.py
===================================================================
--- wasko/branches/2.0/mpulsweb/model/case.py	2010-05-03 10:50:19 UTC (rev 2589)
+++ wasko/branches/2.0/mpulsweb/model/case.py	2010-05-03 10:52:07 UTC (rev 2590)
@@ -502,7 +502,7 @@
 class MpulsCase:
 
     def __init__(self, id=None, preset=None, state_id=None, state_status=None,
-                 state_access=None):
+                 state_access=None, state_phase=None):
         self.id = id
         if preset is None:
             preset = dict()
@@ -514,10 +514,10 @@
         self.appointments = []
         self.privacy_statement = None
         #self.digest = None (TODO: Seems not to be used)
-        self.init_state(state_id, state_status, state_access)
+        self.init_state(state_id, state_status, state_access, state_phase)
 
-    def init_state(self, state_id, status, access):
-        self.state = MpulsCaseState(state_id, self.id, status, access)
+    def init_state(self, state_id, status, access, phase):
+        self.state = MpulsCaseState(state_id, self.id, status, access, phase)
 
     @classmethod
     def set_fields(cls, raw_fields):
@@ -972,7 +972,8 @@
         return self.case_cls(result["id"], preset=self._build_preset(result),
                              state_id=result["s_id"],
                              state_status=result["status"],
-                             state_access=result["zugriff"])
+                             state_access=result["zugriff"],
+                             state_phase=result["phase"])
 
     def createNew(self, init=True, uuid=None, data=None):
         """Create a new case in the database and return the case object.
@@ -1055,12 +1056,12 @@
         * anonymised (5)
     """
 
-    def __init__(self, id=None, master_id=None, state=None, access=None):
+    def __init__(self, id=None, master_id=None, state=None, access=None, phase=None):
         self.id = id
         self.master_id = master_id
         self.state = state
         self.access = access
-        self.phase = None
+        self.phase = phase 
         self._last_date = None
 
         if self.master_id is not None and self.id is None:



More information about the Mpuls-commits mailing list