[Mpuls-commits] r4443 - base/trunk/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 28 15:48:41 CET 2010


Author: torsten
Date: 2010-12-28 15:48:41 +0100 (Tue, 28 Dec 2010)
New Revision: 4443

Modified:
   base/trunk/mpulsweb/lib/search.py
Log:
JOIN fkz_table on evaluations search to display the FKZ and name of the
agency.


Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py	2010-12-28 14:35:04 UTC (rev 4442)
+++ base/trunk/mpulsweb/lib/search.py	2010-12-28 14:48:41 UTC (rev 4443)
@@ -484,12 +484,13 @@
     FROM master_tbl_view m
     JOIN ka_status_tbl_view st ON m.id = st.master_id
     JOIN ka_benutzer_tbl b ON m.bearbeiter_id = b.id
+    JOIN fkz_tbl f ON f.id::integer = m.fkz::integer
     WHERE %(where)s
     %(group)s
     %(order)s
     """
 
-    SEARCH_FIELDS = """fkz, count(m.id) as count"""
+    SEARCH_FIELDS = """m.fkz as id, f.fkz, f.name, count(m.id) as count, max(st.zugriff) as time"""
 
     VALID_OPTIONS = (Search.VALID_OPTIONS
                      + ("state", "phase", "own", "standin", "editor", "branch",
@@ -511,7 +512,7 @@
         return self.SEARCH_ORDER % (sort_field, sort_order)
 
     def get_group(self, options):
-        group_field = options.get('group_field', "m.fkz")
+        group_field = options.get('group_field', "f.fkz, m.fkz, f.name")
         return self.GROUP_BY % (group_field)
 
     def _build_sql(self, options):



More information about the Mpuls-commits mailing list