[Mpuls-commits] r288 - in wasko/trunk: . waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 23 17:15:24 CET 2009


Author: teichmann
Date: 2009-02-23 17:15:20 +0100 (Mon, 23 Feb 2009)
New Revision: 288

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/model/casedocument.py
Log:
case document: if getData is called with only one argument the needed case id is fetched from session.


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-02-23 15:41:28 UTC (rev 287)
+++ wasko/trunk/ChangeLog.txt	2009-02-23 16:15:20 UTC (rev 288)
@@ -1,5 +1,10 @@
 2009-02-23	Sascha L. Teichmann <teichmann at intevation.de>
 
+	* waskaweb/model/casedocument.py: if getData is called with only one
+	  argument the needed case id is fetched from session.
+
+2009-02-23	Sascha L. Teichmann <teichmann at intevation.de>
+
 	* waskaweb/model/datapage.py: Access depending vars in expression thru
 	  thread local page cache.
 

Modified: wasko/trunk/waskaweb/model/casedocument.py
===================================================================
--- wasko/trunk/waskaweb/model/casedocument.py	2009-02-23 15:41:28 UTC (rev 287)
+++ wasko/trunk/waskaweb/model/casedocument.py	2009-02-23 16:15:20 UTC (rev 288)
@@ -33,7 +33,8 @@
 from waskaweb.model.data           import PageNode, WidgetCollector, RuleLeaf
 from waskaweb.model.datapage       import PageStore, EmptyPageStore
 
-from paste.registry import StackedObjectProxy
+from pylons          import session
+from paste.registry  import StackedObjectProxy
 
 from traceback import print_exc
 
@@ -96,7 +97,11 @@
     def getPageOfWidget(self, name):
         return self.widgets2pages[name]
 
-    def getData(self, name, ds_id):
+    def getData(self, name, ds_id = None):
+        if ds_id is None:
+            case = session.get('case')
+            if not case: return None
+            ds_id = case.id
         page_name = self.widgets2pages.get(name)
         if not page_name: return None
         page_store = self.getPageStore(page_name, ds_id)



More information about the Mpuls-commits mailing list