r89239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89238‎ | r89239 | r89240 >
Date:22:56, 31 May 2011
Author:rfaulk
Status:deferred
Tags:
Comment:
Log Miner Mining reporting - this source will serve to generate reporting for auditing on squid log mining
Modified paths:
  • /trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML (added) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/__init__.py (added) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/models.py (added) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/tests.py (added) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/urls.py (added) (history)
  • /trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/views.py (added) (history)

Diff [purge]

Index: trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/views.py
@@ -0,0 +1,40 @@
 2+from django.shortcuts import render_to_response
 3+from django.http import Http404
 4+from django.shortcuts import render_to_response, get_object_or_404
 5+from django.template import RequestContext
 6+from django.http import HttpResponseRedirect, HttpResponse
 7+from django.core.urlresolvers import reverse
 8+
 9+import sys
 10+import os
 11+import datetime
 12+
 13+import Fundraiser_Tools.classes.Helper as Hlp
 14+import Fundraiser_Tools.classes.DataReporting as DR
 15+import Fundraiser_Tools.classes.DataLoader as DL
 16+import Fundraiser_Tools.classes.FundraiserDataHandler as FDH
 17+import Fundraiser_Tools.classes.TimestampProcessor as TP
 18+import Fundraiser_Tools.settings as projSet
 19+import operator
 20+
 21+
 22+"""
 23+ Index page for finding the latest camapigns. Displays a list of recent campaigns with more than k donations over the last n hours.
 24+
 25+"""
 26+def index(request):
 27+
 28+ sltl = DL.SquidLogTableLoader()
 29+
 30+ # Show the squid log table
 31+ squid_table = sltl.get_all_rows_unique_start_time()
 32+
 33+ # Show the latest log that has been or is loading and its progress
 34+ completion_rate = sltl.get_completion_rate_of_latest_log()
 35+
 36+ return render_to_response('LML/index.html', {'squid_table' : squid_table, 'completion_rate' : completion_rate}, context_instance=RequestContext(request))
 37+
 38+
 39+
 40+
 41+
\ No newline at end of file
Index: trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/__init__.py
Index: trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/tests.py
@@ -0,0 +1,16 @@
 2+"""
 3+This file demonstrates writing tests using the unittest module. These will pass
 4+when you run "manage.py test".
 5+
 6+Replace this with more appropriate tests for your application.
 7+"""
 8+
 9+from django.test import TestCase
 10+
 11+
 12+class SimpleTest(TestCase):
 13+ def test_basic_addition(self):
 14+ """
 15+ Tests that 1 + 1 always equals 2.
 16+ """
 17+ self.assertEqual(1 + 1, 2)
Index: trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/models.py
@@ -0,0 +1,3 @@
 2+from django.db import models
 3+
 4+# Create your models here.
Index: trunk/fundraiser-statistics/fundraiser-scripts/web_reporting/LML/urls.py
@@ -0,0 +1,6 @@
 2+from django.conf.urls.defaults import *
 3+
 4+
 5+urlpatterns = patterns('',
 6+ (r'^$', 'LML.views.index'),
 7+)

Status & tagging log