[Mpuls-commits] r2115 - wasko/branches/2.0/jmdweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Mar 24 15:45:46 CET 2010


Author: torsten
Date: 2010-03-24 15:45:46 +0100 (Wed, 24 Mar 2010)
New Revision: 2115

Modified:
   wasko/branches/2.0/jmdweb/model/case.py
Log:
* jmdweb/model/case.py (SessionCase): Deleted. Defined in mpulsweb
now.


Modified: wasko/branches/2.0/jmdweb/model/case.py
===================================================================
--- wasko/branches/2.0/jmdweb/model/case.py	2010-03-24 14:42:29 UTC (rev 2114)
+++ wasko/branches/2.0/jmdweb/model/case.py	2010-03-24 14:45:46 UTC (rev 2115)
@@ -43,18 +43,12 @@
 from mpulsweb.model.phase import PhaseFactory
 from mpulsweb.model.agencysettings import Agency
 from mpulsweb.model.case import MpulsCase, MpulsCaseFactory, MpulsCaseOverview, \
-    MpulsCaseBundle, MpulsCaseState
+    MpulsCaseBundle, MpulsCaseState, SessionCase
 
 from jmdweb.model.statement import PrivacyStatement, DiscretionStatement
 
 log = logging.getLogger(__name__)
 
-def save_getone(params, k, v):
-    try:
-        return params.getone(k)
-    except KeyError:
-        return v
-
 # SQL STATEMENTS
 INIT_CASE_SQL = """
 UPDATE master_tbl_view
@@ -95,46 +89,6 @@
         finally:
             db.recycleConnection(conn, cur)
 
-class SessionCase:
-
-    """This class holds all needed information for the currently selected case
-    """
-
-    def __init__(self, id=None, page_id=None, state=None,
-                 privacy_statement=False, **kw):
-        if id is None:
-            self.id = None
-        else:
-            self.id = int(id)
-
-        self.page_id = page_id
-        self.state = state
-        self.privacy_statement = privacy_statement
-
-        for field in self._session_fields():
-            setattr(self, field.alias, kw.get(field.alias, field.default))
-
-    def _session_fields(self):
-        return g.case_factory.get_session_fields()
-
-    def getState(self):
-        return self.state
-
-    def setPageId(self, id):
-        self.page_id = id
-
-    def getPageId(self):
-        return self.page_id
-
-    def hasPrivacyStatement(self):
-        return self.privacy_statement
-
-    def setData(self, params):
-        for field in self._session_fields():
-            setattr(self, field.alias,
-                    field.convert(save_getone(params, field.name,
-                                              field.default)))
-
 class Case(MpulsCase):
 
     def __init__(self, id=None, preset=None, state_id=None, state_status=None,



More information about the Mpuls-commits mailing list