summaryrefslogtreecommitdiff
path: root/releng/views.py
diff options
context:
space:
mode:
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: