r87283 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87282‎ | r87283 | r87284 >
Date:19:20, 2 May 2011
Author:rfaulk
Status:deferred
Tags:
Comment:
- Added query info for report_campaign_totals in methods (get_metric_index, get_key_index, format_query)
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/classes/QueryData.py (modified) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/QueryData.py
@@ -28,7 +28,7 @@
2929 __revision__ = "$Rev$"
3030 __date__ = "November 28th, 2010"
3131
32 -import TimestampProcessor as TP
 32+import Fundraiser_Tools.classes.TimestampProcessor as TP
3333 import datetime
3434
3535 def format_query(query_name, sql_stmnt, args):
@@ -187,7 +187,13 @@
188188 interval = args[3]
189189
190190 sql_stmnt = sql_stmnt % (campaign, '%', '%', '%', '%', interval, interval, start_time, end_time, campaign, '%', '%', '%', '%', interval, interval, start_time, end_time, campaign)
 191+
 192+ elif query_name == 'report_campaign_totals':
 193+ start_time = args[0]
 194+ end_time = args[1]
191195
 196+ sql_stmnt = sql_stmnt % (start_time, end_time)
 197+
192198 else:
193199 return 'no such table\n'
194200
@@ -214,6 +220,8 @@
215221 return 1
216222 elif query_name == 'report_campaign_metrics_minutely_total':
217223 return 1
 224+ elif query_name == 'report_campaign_totals':
 225+ return 0
218226
219227
220228 def get_count_index(query_name):
@@ -438,6 +446,11 @@
439447 return 2
440448 else:
441449 return -1
 450+ elif query_name == 'report_campaign_totals':
 451+ if metric_name == 'donations':
 452+ return 1
 453+ else:
 454+ return -1
442455
443456 else:
444457 return 'no such table'

Status & tagging log