summaryrefslogtreecommitdiff
path: root/releng/views.py
diff options
context:
space:
mode:
authorTom Willemsen <ryuslash@gmail.com>2011-08-17 01:26:23 +0200
committerDan McGee <dan@archlinux.org>2011-08-17 07:51:42 -0500
commit7954617a0593632d749d7e8b60beab2aae1669ba (patch)
tree73f2f77666212d206b724f431babed41b4366fdc /releng/views.py
parente3ac14389448a73d9f9b8286a25930f3978784fb (diff)
New page ISO Overview
ISO Overview shows a simple list of all the ISOs that are available and how many times they've been tested successfully or have failed. Signed-off-by: Tom Willemsen <ryuslash@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'releng/views.py')
-rw-r--r--releng/views.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/releng/views.py b/releng/views.py
index 1d4a0b5e..d90a5b9a 100644
--- a/releng/views.py
+++ b/releng/views.py
@@ -1,5 +1,6 @@
from django import forms
from django.conf import settings
+from django.db.models import Count
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect
from django.views.generic.simple import direct_to_template
@@ -138,4 +139,17 @@ def test_results_for(request, option, value):
def submit_test_thanks(request):
return direct_to_template(request, "releng/thanks.html", None)
+def iso_overview(request):
+ isos = Iso.objects.all().order_by('-pk')
+ successes = dict(Iso.objects.values_list('pk').filter(test__success=True).annotate(ct=Count('test')))
+ failures = dict(Iso.objects.values_list('pk').filter(test__success=False).annotate(ct=Count('test')))
+ for iso in isos:
+ iso.successes = successes.get(iso.pk, 0)
+ iso.failures = failures.get(iso.pk, 0)
+
+ context = {
+ 'isos': isos
+ }
+ return direct_to_template(request, 'releng/iso_overview.html', context)
+
# vim: set ts=4 sw=4 et: