[Mpuls-commits] r241 - in waska/trunk: . waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 5 14:35:09 CET 2009


Author: torsten
Date: 2009-02-05 14:35:08 +0100 (Thu, 05 Feb 2009)
New Revision: 241

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/lib/search.py
Log:
fixed issue 722


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2009-02-05 13:27:53 UTC (rev 240)
+++ waska/trunk/ChangeLog.txt	2009-02-05 13:35:08 UTC (rev 241)
@@ -27,6 +27,11 @@
 	  waskaweb/templates/main.mako: Renamed "quartalsbericht" to
 	  Zwischenbericht.
 
+	Fixed issue 722
+
+	* waskaweb/lib/search.py: Chaged definition of the timeframe in search
+	strings.
+
 2009-02-04	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Added new evalution adele stammblatt. 

Modified: waska/trunk/waskaweb/lib/search.py
===================================================================
--- waska/trunk/waskaweb/lib/search.py	2009-02-05 13:27:53 UTC (rev 240)
+++ waska/trunk/waskaweb/lib/search.py	2009-02-05 13:35:08 UTC (rev 241)
@@ -204,12 +204,15 @@
         interval_end_date = options.get('interval_end_date', d.strftime('%Y-%m-%d'))
         fields = {'start_field': interval_start_field, 'start_date': interval_start_date, 'end_field': interval_end_field, 'end_date': interval_end_date} 
         if interval_start_date != '1970-01-01':
-            time_interval = "(coalesce(%(start_field)s, '1970-01-01'::date) <= '%(end_date)s'::date AND \
-            coalesce(%(start_field)s, '1970-01-01'::date) <= coalesce(%(end_field)s, st.zugriff) AND \
-            ((m.id in (SELECT id from master_tbl_incm_view) AND \
-            (coalesce(%(end_field)s, now()) >= '%(start_date)s'::date)) OR \
-            (st.zugriff >= '%(start_date)s'::date)))" % fields
+            time_interval = "(coalesce(%(start_field)s, '1970-01-01'::date) <= '%(end_date)s'::date \
+            AND (coalesce(%(end_field)s, now()) >= '%(start_date)s'::date))" % fields
 
+            #time_interval = "(coalesce(%(start_field)s, '1970-01-01'::date) <= '%(end_date)s'::date AND \
+            #coalesce(%(start_field)s, '1970-01-01'::date) <= coalesce(%(end_field)s, st.zugriff) AND \
+            #((m.id in (SELECT id from master_tbl_incm_view) AND \
+            #(coalesce(%(end_field)s, now()) >= '%(start_date)s'::date)) OR \
+            #(st.zugriff >= '%(start_date)s'::date)))" % fields
+
         sort_field = options.get('sort_field', "name_1")
         sort_order       = options.get('sort_order', "desc")
         fields['needle'] = " ".join(search) 
@@ -283,12 +286,15 @@
             interval_end_date = options.get('interval_end_date', d.strftime('%Y-%m-%d'))
             fields = {'start_field': interval_start_field, 'start_date': interval_start_date, 'end_field': interval_end_field, 'end_date': interval_end_date} 
             if interval_start_date != '1970-01-01':
-                time_interval = "(coalesce(%(start_field)s, '1970-01-01'::date) <= '%(end_date)s'::date AND \
-                coalesce(%(start_field)s, '1970-01-01'::date) <= coalesce(%(end_field)s, st.zugriff) AND \
-                ((m.id in (SELECT id from master_tbl_incm_view) AND \
-                (coalesce(%(end_field)s, now()) >= '%(start_date)s'::date)) OR \
-                (st.zugriff >= '%(start_date)s'::date)))" % fields
+                time_interval = "(coalesce(%(start_field)s, '1970-01-01'::date) <= '%(end_date)s'::date \
+                AND (coalesce(%(end_field)s, now()) >= '%(start_date)s'::date))" % fields
 
+                #time_interval = "(coalesce(%(start_field)s, '1970-01-01'::date) <= '%(end_date)s'::date AND \
+                #coalesce(%(start_field)s, '1970-01-01'::date) <= coalesce(%(end_field)s, st.zugriff) AND \
+                #((m.id in (SELECT id from master_tbl_incm_view) AND \
+                #(coalesce(%(end_field)s, now()) >= '%(start_date)s'::date)) OR \
+                #(st.zugriff >= '%(start_date)s'::date)))" % fields
+
         #Phases
         phases = 'TRUE' #default
         if phaseslist:



More information about the Mpuls-commits mailing list