[Mpuls-commits] r2018 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 19 08:14:14 CET 2010


Author: torsten
Date: 2010-03-19 08:14:14 +0100 (Fri, 19 Mar 2010)
New Revision: 2018

Modified:
   wasko/branches/2.0/mpulsweb/lib/search.py
Log:
* mpulsweb/lib/search.py (CaseSearch.__get_fields): Check if there are
  any additional fields defined to fetch. Fixed SQL syntax error if
  no fields are defined.


Modified: wasko/branches/2.0/mpulsweb/lib/search.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/search.py	2010-03-19 07:12:41 UTC (rev 2017)
+++ wasko/branches/2.0/mpulsweb/lib/search.py	2010-03-19 07:14:14 UTC (rev 2018)
@@ -24,7 +24,7 @@
     WHERE %(where)s
     %(order)s
 """
-SEARCH_FIELDS = """m.id, %s, st.status, st.zugriff, st.id as s_id """
+SEARCH_FIELDS = """m.id, %s st.status, st.zugriff, st.id as s_id """
 SEARCH_ORDER = """ORDER BY %s %s"""
 
 log = logging.getLogger(__name__)
@@ -100,6 +100,7 @@
 
     def __get_fields(self, options):
         retrieve = ", ".join("m." + field for field in self.retrieve_fields)
+        if retrieve: retrieve = "%s," % retrieve
         return SEARCH_FIELDS % retrieve
 
     def __get_where(self, search, options, allowed_states, bad_types, phaseslist, fieldsdic):



More information about the Mpuls-commits mailing list