summaryrefslogtreecommitdiff
path: root/isotests/views.py
diff options
context:
space:
mode:
authorTom Willemsen <tom.willemsen@archlinux.us>2011-03-01 20:43:37 +0100
committerDan McGee <dan@archlinux.org>2011-04-28 13:15:58 -0500
commitf4229daac60fa90cbf8d77bfdffd88a467869b3c (patch)
tree79b535489f289946067e3d09f8e4f832fabf4fa0 /isotests/views.py
parent1547c7c49a1852852ffbac0737d0ffdf54addda9 (diff)
isotests: view updates, choices->models, show results, admin
* Started changing the view portion * Changed choices to models * Show the latest failed/succeeded tests on results page * Added some more admin pages Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'isotests/views.py')
-rw-r--r--isotests/views.py42
1 files changed, 35 insertions, 7 deletions
diff --git a/isotests/views.py b/isotests/views.py
index 742be8ff..738fa90d 100644
--- a/isotests/views.py
+++ b/isotests/views.py
@@ -1,9 +1,9 @@
# Create your views here.
from django.http import HttpResponse, HttpResponseRedirect
-from django.forms import ModelForm
-from isotests.models import Test
+from django.forms import ModelForm, DateField
+from isotests.models import *
from django.shortcuts import render_to_response
-from django.template import RequestContext
+from django.template import RequestContext, Context, loader
class TestForm(ModelForm):
class Meta:
@@ -18,7 +18,35 @@ def add_result(request):
else:
form = TestForm() # An unbound form
- return render_to_response('isotests/add.html', {
- 'form': form,
- },
- context_instance=RequestContext(request))
+ return render_to_response('isotests/add.html', { 'form': form, },
+ context_instance=RequestContext(request))
+
+def view_results(request):
+ result_success_list = Test.objects.filter(success=True)
+ result_failed_list = Test.objects.filter(success=False)
+
+ architecture_list = Architecture.objects.all()
+ isotype_list = Isotype.objects.all()
+ boottype_list = Boottype.objects.all()
+ hardware_list = Hardware.objects.all()
+ installtype_list = InstallType.objects.all()
+ source_list = Source.objects.all()
+ clockchoice_list = Clockchoice.objects.all()
+ module_list = Module.objects.all()
+ filesystem_list = Filesystem.objects.all()
+ bootloader_list = Bootloader.objects.all()
+
+ t = loader.get_template("isotests/results.html")
+ c = Context({
+ 'arch_choices': architecture_list,
+ 'isotype_choices': isotype_list,
+ 'boottype_choices': boottype_list,
+ 'hardware_list': hardware_list,
+ 'installtype_list': installtype_list,
+ 'source_list': source_list,
+ 'clock_choices': clockchoice_list,
+ 'filesystem_list': filesystem_list,
+ 'module_list': module_list,
+ 'bootloader_list': bootloader_list,
+ })
+ return HttpResponse(t.render(c))