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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 16 18:29:58 CET 2010


Author: bh
Date: 2010-02-16 18:29:57 +0100 (Tue, 16 Feb 2010)
New Revision: 1644

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/waskaweb/model/case.py
Log:
* waskaweb/model/case.py (SessionCase._session_fields): New.
SessionCase internal frontend for the get_session_fields method of
the case factory
(SessionCase.__init__, SessionCase.setData)
(SessionCase.toFormData): Use _session_fields.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-16 17:15:18 UTC (rev 1643)
+++ wasko/branches/2.0/ChangeLog	2010-02-16 17:29:57 UTC (rev 1644)
@@ -1,5 +1,13 @@
 2010-02-16  Bernhard Herzog  <bh at intevation.de>
 
+	* waskaweb/model/case.py (SessionCase._session_fields): New.
+	SessionCase internal frontend for the get_session_fields method of
+	the case factory
+	(SessionCase.__init__, SessionCase.setData)
+	(SessionCase.toFormData): Use _session_fields.
+
+2010-02-16  Bernhard Herzog  <bh at intevation.de>
+
 	* waskaweb/model/case.py (CaseOverview.search): Access the case
 	field descriptions through g.case_factory instead of the Case
 	class.

Modified: wasko/branches/2.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/case.py	2010-02-16 17:15:18 UTC (rev 1643)
+++ wasko/branches/2.0/waskaweb/model/case.py	2010-02-16 17:29:57 UTC (rev 1644)
@@ -574,9 +574,12 @@
         self.state = state
         self.privacy_statement = privacy_statement
 
-        for field in Case.get_session_fields():
+        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
 
@@ -590,14 +593,14 @@
         return self.privacy_statement
 
     def setData(self, params):
-        for field in Case.get_session_fields():
+        for field in self._session_fields():
             setattr(self, field.alias, desc.convert(save_getone(params,
                                                                 field.name,
                                                                 field.default)))
 
     def toFormData(self):
         data = {}
-        for desc in Case.get_session_fields():
+        for desc in self._session_fields():
             data[desc.formedname] = getattr(self, desc.name)
         return data
 



More information about the Mpuls-commits mailing list