diff options
author | Tom Willemsen <ryuslash@gmail.com> | 2011-08-17 01:26:23 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-17 07:51:42 -0500 |
commit | 7954617a0593632d749d7e8b60beab2aae1669ba (patch) | |
tree | 73f2f77666212d206b724f431babed41b4366fdc /releng | |
parent | e3ac14389448a73d9f9b8286a25930f3978784fb (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')
-rw-r--r-- | releng/urls.py | 1 | ||||
-rw-r--r-- | releng/views.py | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/releng/urls.py b/releng/urls.py index 4a125dff..239ad02b 100644 --- a/releng/urls.py +++ b/releng/urls.py @@ -6,6 +6,7 @@ feedback_patterns = patterns('releng.views', (r'^thanks/$', 'submit_test_thanks', {}, 'releng-test-thanks'), (r'^iso/(?P<iso_id>\d+)/$', 'test_results_iso', {}, 'releng-results-iso'), (r'^(?P<option>.+)/(?P<value>\d+)/$','test_results_for', {}, 'releng-results-for'), + (r'^iso/overview/$', 'iso_overview', {}, 'releng-iso-overview'), ) urlpatterns = patterns('', 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: |