[Mpuls-commits] r3321 - base/trunk/mpulsweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 3 17:07:39 CEST 2010


Author: torsten
Date: 2010-08-03 17:07:39 +0200 (Tue, 03 Aug 2010)
New Revision: 3321

Modified:
   base/trunk/mpulsweb/model/case.py
Log:
* mpulsweb/model/case.py (SessionCase.getData: New function which returns the data of saved fields in sessioncase.


Modified: base/trunk/mpulsweb/model/case.py
===================================================================
--- base/trunk/mpulsweb/model/case.py	2010-08-03 15:05:53 UTC (rev 3320)
+++ base/trunk/mpulsweb/model/case.py	2010-08-03 15:07:39 UTC (rev 3321)
@@ -958,6 +958,13 @@
             setattr(self, field.alias,
                     field.convert(save_getone(params, field.name,
                                               field.default)))
+    def getData(self):
+        data = {}
+        for field in self._session_fields():
+            value = self.get_value(field.alias)
+            if value is not None:
+                data[field.name] = value
+        return data
 
     def _session_fields(self):
         return g.case_factory.get_session_fields()



More information about the Mpuls-commits mailing list