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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jan 7 12:32:38 CET 2011


Author: torsten
Date: 2011-01-07 12:32:37 +0100 (Fri, 07 Jan 2011)
New Revision: 4472

Modified:
   base/trunk/mpulsweb/lib/search.py
Log:
* mpulsweb/lib/search.py (EvaluationSearch): Modified search query.
	Result will now always list all agencys even if there are no cases for the
	agency.


Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py	2011-01-06 13:06:45 UTC (rev 4471)
+++ base/trunk/mpulsweb/lib/search.py	2011-01-07 11:32:37 UTC (rev 4472)
@@ -483,17 +483,20 @@
 class EvaluationSearch(Search):
 
     SEARCH_QUERY = """
-    SELECT %(fields)s
-    FROM master_tbl_view m
+    SELECT %(fields)s 
+    FROM fkz_tbl f 
+    LEFT OUTER JOIN (SELECT m.fkz, m.id, st.zugriff  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 ka_benutzer_tbl b ON m.bearbeiter_id = b.id 
     JOIN fkz_tbl f ON f.id::integer = m.fkz::integer
-    WHERE %(where)s
+    WHERE %(where)s) m
+    ON f.id::integer = m.fkz::integer
     %(group)s
     %(order)s
     """
 
-    SEARCH_FIELDS = """m.fkz as id, f.fkz, f.name, count(m.id) as count, max(st.zugriff) as time"""
+    SEARCH_FIELDS = """m.fkz as id, f.fkz, f.name, count(m.id) as count, max(m.zugriff) as time"""
 
     VALID_OPTIONS = (Search.VALID_OPTIONS
                      + ("state", "phase", "own", "standin", "editor", "branch",



More information about the Mpuls-commits mailing list