[Mpuls-commits] r5128 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jun 22 16:06:44 CEST 2011


Author: torsten
Date: 2011-06-22 16:06:43 +0200 (Wed, 22 Jun 2011)
New Revision: 5128

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/case_bundle.py
Log:
Issue2005: Build caselist based on fields viewable in overview instead of hardcoded "first and lastname".



Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-06-22 13:31:17 UTC (rev 5127)
+++ base/trunk/ChangeLog	2011-06-22 14:06:43 UTC (rev 5128)
@@ -1,3 +1,9 @@
+2011-06-22  Torsten Irländer <torsten.irlaender at intevation.de>
+
+	* mpulsweb/controllers/case_bundle.py: Issue2005: Build caselist
+	based on fields viewable in overview instead of hardcoded "first and
+	lastname".
+
 2011-06-22  Bernhard Herzog  <bh at intevation.de>
 
 	* mpulsweb/lib/db.py (DB.getConnection): Fix typos in comment.

Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py	2011-06-22 13:31:17 UTC (rev 5127)
+++ base/trunk/mpulsweb/controllers/case_bundle.py	2011-06-22 14:06:43 UTC (rev 5128)
@@ -224,9 +224,13 @@
 
     def _buildCaseList(self, bundle):
         list = ["<ul>"]
-        for case in bundle.getCases():
-            list.append("<li>%s, %s</li>" % (escape(NA(case.first_name)),
-                                             escape(NA(case.last_name))))
+        cases = bundle.getCases()
+        overview_fields = cases[0].get_overview_fields()
+        for case in cases:
+            x = []
+            for f in overview_fields:
+                    x.append(case.__getattr__(f.alias))
+            list.append("<li>%s</li>" % ", ".join([escape(NA(y)) for y in x]))
         list.append("</ul>")
         return list
 



More information about the Mpuls-commits mailing list