[Mpuls-commits] r3416 - in base/trunk: . mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Aug 17 12:35:37 CEST 2010
Author: bh
Date: 2010-08-17 12:35:35 +0200 (Tue, 17 Aug 2010)
New Revision: 3416
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/lib/search.py
Log:
* mpulsweb/lib/search.py (CaseSearch.get_where): Simply join the
sub-clauses with " AND ". The SEARCH_WHERE template didn't do
anything else now.
(SEARCH_WHERE): Removed. No longer needed.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-08-17 09:01:57 UTC (rev 3415)
+++ base/trunk/ChangeLog 2010-08-17 10:35:35 UTC (rev 3416)
@@ -1,5 +1,12 @@
2010-08-17 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/lib/search.py (CaseSearch.get_where): Simply join the
+ sub-clauses with " AND ". The SEARCH_WHERE template didn't do
+ anything else now.
+ (SEARCH_WHERE): Removed. No longer needed.
+
+2010-08-17 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/lib/search.py (CaseSearch.get_status_clause): New.
Build the conditional clause that selects cases based on the
status.
Modified: base/trunk/mpulsweb/lib/search.py
===================================================================
--- base/trunk/mpulsweb/lib/search.py 2010-08-17 09:01:57 UTC (rev 3415)
+++ base/trunk/mpulsweb/lib/search.py 2010-08-17 10:35:35 UTC (rev 3416)
@@ -30,14 +30,6 @@
SEARCH_FIELDS = """m.id, m.phase, %s st.status, st.zugriff, st.id as s_id,
ARRAY(SELECT tag_id FROM nm_tags_cases_view WHERE case_id = m.id) AS tags """
SEARCH_ORDER = """ORDER BY %s %s"""
-SEARCH_WHERE = """
- %s
- AND %s
- AND %s
- AND %s
- AND %s
- AND %s
-"""
log = logging.getLogger(__name__)
@@ -223,9 +215,8 @@
time_interval = self.get_dates_clause(options, phaseslist)
status_expr = self.get_status_clause(options, allowed_states)
- return SEARCH_WHERE % (needle_expr, status_expr,
- allowed_viewer, editor,
- time_interval, phases)
+ return " AND ".join((needle_expr, status_expr, allowed_viewer, editor,
+ time_interval, phases))
def get_order(self, options):
sort_field = options.get('sort_field', "m.id")
More information about the Mpuls-commits
mailing list