[Mpuls-commits] r1674 - in wasko/branches/2.0: . waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 22 13:08:08 CET 2010


Author: bh
Date: 2010-02-22 13:08:08 +0100 (Mon, 22 Feb 2010)
New Revision: 1674

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/waskaweb/model/case.py
Log:
* waskaweb/model/case.py (State.__init__): Add parameters: id,
state, access.  Now it's possible to instantiate State in one go,
without having to call setData separately.
(CaseFactory.loadById): Pass the master_id of the State object as
a keyword argument because the order of the parameters of the
State constructor has changed


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-22 10:52:51 UTC (rev 1673)
+++ wasko/branches/2.0/ChangeLog	2010-02-22 12:08:08 UTC (rev 1674)
@@ -1,5 +1,14 @@
 2010-02-22  Bernhard Herzog  <bh at intevation.de>
 
+	* waskaweb/model/case.py (State.__init__): Add parameters: id,
+	state, access.  Now it's possible to instantiate State in one go,
+	without having to call setData separately.
+	(CaseFactory.loadById): Pass the master_id of the State object as
+	a keyword argument because the order of the parameters of the
+	State constructor has changed
+
+2010-02-22  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/model/case.py (State.setAccessTime): Removed. Not used
 	anywhere.
 

Modified: wasko/branches/2.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/case.py	2010-02-22 10:52:51 UTC (rev 1673)
+++ wasko/branches/2.0/waskaweb/model/case.py	2010-02-22 12:08:08 UTC (rev 1674)
@@ -358,7 +358,7 @@
         finally:
             db.recycleConnection(conn, c)
 
-        return self.case_cls(id, state=State(id),
+        return self.case_cls(id, state=State(master_id=id),
                              preset=self._build_preset(result))
 
     def loadFromQueryResult(self, result):
@@ -758,16 +758,15 @@
         * anonymised (5)
     """
 
-    def __init__(self, master_id=None):
+    def __init__(self, id=None, master_id=None, state=None, access=None):
+        self.id         = id
         self.master_id  = master_id
-        self.id         = None
-        self.state      = None
-        self.access     = None
+        self.state      = state
+        self.access     = access
         self.phase      = None
         self._last_date = None
 
-        if master_id:
-            self.master_id = master_id
+        if self.master_id is not None and self.id is None:
             self._load()
 
     def getLastDateFromDB(self):



More information about the Mpuls-commits mailing list