[Mpuls-commits] r1045 - wasko/branches/2.0/waskaweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Feb 1 12:21:40 CET 2010
Author: torsten
Date: 2010-02-01 12:21:37 +0100 (Mon, 01 Feb 2010)
New Revision: 1045
Modified:
wasko/branches/2.0/waskaweb/controllers/logbook.py
Log:
* waskaweb/controllers/logbook.py (LogbookController.overview): New.
Modified: wasko/branches/2.0/waskaweb/controllers/logbook.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/logbook.py 2010-02-01 10:36:56 UTC (rev 1044)
+++ wasko/branches/2.0/waskaweb/controllers/logbook.py 2010-02-01 11:21:37 UTC (rev 1045)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+#
# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
#
# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
@@ -24,13 +26,27 @@
import logging
from waskaweb.lib.base import *
+from waskaweb.lib.security import checkRole
+from waskaweb.model.logbook import Logbook
log = logging.getLogger(__name__)
class LogbookController(BaseController):
- def index(self, id):
- # Return a rendered template
- # return render('/some/template.mako')
- # or, Return a response
- return 'Hello World'
+ @checkRole(('cm_ka'))
+ def index(self, id, sort_field='datum', sort_order='desc'):
+ return self.overview(id, sort_field, sort_order)
+
+ def overview(self, id, sort_field='datum', sort_order='desc'):
+ id = self._checkInt(id)
+
+ # Load logbook
+ logbook = Logbook()
+ logbook.loadById(int(id), sort_field, sort_order)
+ c.logbook = logbook
+
+ # Build evaluation
+ c.eval_effort = logbook.getEvaluation()
+ return render('/logbook/overview.mako')
+
+# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
More information about the Mpuls-commits
mailing list