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

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 1 16:47:08 CEST 2012


Author: torsten
Date: 2012-10-01 16:47:08 +0200 (Mon, 01 Oct 2012)
New Revision: 6079

Modified:
   base/trunk/mpulsweb/lib/search.py
Log:
Fixed casts and select. Get data from fkz_tbl_view now.


Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py	2012-10-01 14:46:20 UTC (rev 6078)
+++ base/trunk/mpulsweb/lib/search.py	2012-10-01 14:47:08 UTC (rev 6079)
@@ -571,19 +571,19 @@
 
     SEARCH_QUERY = """
     SELECT %(fields)s
-    FROM fkz_tbl f
+    FROM fkz_tbl_view 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 fkz_tbl f ON f.id::integer = m.fkz::integer
+    JOIN fkz_tbl f ON f.id = m.fkz::integer
     WHERE %(where)s) m
-    ON f.id::integer = m.fkz::integer
+    ON f.id = m.fkz::integer
     %(group)s
     %(order)s
     """
 
-    SEARCH_FIELDS = """m.fkz as id, f.fkz, f.name, f.bundesland_id,
+    SEARCH_FIELDS = """f.id, f.fkz, f.name, f.bundesland_id,
     count(m.id) as count, max(m.zugriff) as time
     """
 
@@ -641,7 +641,7 @@
 
     def get_group(self, options):
         group_field = options.get('group_field',
-                                  "f.fkz, m.fkz, f.name, f.bundesland_id")
+                                  "f.id, f.fkz, f.name, f.bundesland_id")
         return self.GROUP_BY % (group_field)
 
     def _build_sql(self, options):



More information about the Mpuls-commits mailing list