[Mpuls-commits] r1631 - wasko/branches/2.0/waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 16 16:33:39 CET 2010


Author: torsten
Date: 2010-02-16 16:33:39 +0100 (Tue, 16 Feb 2010)
New Revision: 1631

Modified:
   wasko/branches/2.0/waskaweb/lib/base.py
Log:
* waskaweb/lib/base.py (BaseController): New. Added method _loadCase
to BaseController for waskaweb.


Modified: wasko/branches/2.0/waskaweb/lib/base.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/base.py	2010-02-16 15:26:16 UTC (rev 1630)
+++ wasko/branches/2.0/waskaweb/lib/base.py	2010-02-16 15:33:39 UTC (rev 1631)
@@ -27,4 +27,20 @@
 Provides the BaseController class for subclassing, and other objects
 utilized by Controllers.
 """
-from mpulsweb.lib.base import *
+
+from mpulsweb.lib.base import _, BaseController as MpulsBaseController, \
+              c, g, h, redirect_to, render, request, response, session
+
+from waskaweb.model.case import CaseFactory, LoadCaseNotExistsError
+
+class BaseController(MpulsBaseController):
+
+    def __init__(self):
+        MpulsBaseController.__init__(self)
+
+    def _loadCase(self, id):
+        factory = CaseFactory()
+        try:
+            return factory.loadById(id)
+        except LoadCaseNotExistsError, err:
+            self.showError()



More information about the Mpuls-commits mailing list