[Mpuls-commits] r1973 - wasko/branches/2.0/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 16 12:51:15 CET 2010


Author: torsten
Date: 2010-03-16 12:51:15 +0100 (Tue, 16 Mar 2010)
New Revision: 1973

Modified:
   wasko/branches/2.0/mpulsweb/controllers/case_overview.py
Log:
* mpulsweb/controllers/case_overview.py: Moved search function to mpulsbase.


Modified: wasko/branches/2.0/mpulsweb/controllers/case_overview.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/case_overview.py	2010-03-16 11:48:10 UTC (rev 1972)
+++ wasko/branches/2.0/mpulsweb/controllers/case_overview.py	2010-03-16 11:51:15 UTC (rev 1973)
@@ -6,6 +6,7 @@
 
 from mpulsweb.lib.base import c, h, render, request, session, BaseController
 from mpulsweb.lib.security import checkRole
+from mpulsweb.lib.validators import SearchCaseForm
 from mpulsweb.model.user import UserListObject
 from mpulsweb.model.case import MpulsCaseOverview
 
@@ -203,4 +204,18 @@
         return formencode.htmlfill.render(unicode(overview, 'utf-8'),
                                           defaults=form_defaults_copy)
 
+    @checkRole(('admin', 'cm', 'pt_dlr'))
+    def search(self):
+        validator = SearchCaseForm()
+        c.form_result = {}
+        c.form_errors = {}
+        try:
+            form_result = validator.to_python(request.params)
+        except formencode.Invalid, error:
+            form_result = error.value
+            form_errors = error.error_dict or {}
+        session['CASE_OVERVIEW_SEARCHOPTIONS'] = form_result
+        session.save()
+        return self.overview()
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list