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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 26 09:18:55 CET 2010


Author: torsten
Date: 2010-02-26 09:18:55 +0100 (Fri, 26 Feb 2010)
New Revision: 1832

Modified:
   wasko/branches/2.0/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py: Import ConsistenceCheckException from
model.phase now. 
* mpulsweb/model/case.py (MpulsCase.check_consistence): Implement
consistence check.


Modified: wasko/branches/2.0/mpulsweb/model/case.py
===================================================================
--- wasko/branches/2.0/mpulsweb/model/case.py	2010-02-26 08:16:17 UTC (rev 1831)
+++ wasko/branches/2.0/mpulsweb/model/case.py	2010-02-26 08:18:55 UTC (rev 1832)
@@ -39,16 +39,14 @@
 from mpulsweb.lib.helpers import ensure_unicode
 from mpulsweb.lib.db import PostgresDBInterface, db
 
+from mpulsweb.model.phase import PhaseFactory, ConsistenceCheckException
 
+
 log = logging.getLogger(__name__)
 
 
 LOAD_CASE_SQL = """SELECT %(fields)s FROM master_tbl_view WHERE id = %%(id)s"""
 
-class ConsistenceCheckException(Exception):
-    def __init__(self, value):
-        self.value = value
-
 class LoadCaseNotExistsError(Exception):
 
     def __init__(self, value):
@@ -234,7 +232,8 @@
         consistent up to the current phase. A case is consistent if no required
         field are missing and all relevant dates on phases are set
         """
-        pass
+        phaseslist = PhaseFactory().load(self.id)
+        phaseslist.check_consistence()
 
     def check_anonymizeability(self):
         """Raises ConsistenceCheckException if the case is not in a anonymizable state.  



More information about the Mpuls-commits mailing list