summaryrefslogtreecommitdiff
path: root/patchtracker/views.py
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2010-05-16 11:58:36 +0200
committerSean Finney <seanius@debian.org>2010-05-16 12:00:17 +0200
commitb8f7b08f207b23998607771a66b12925d9fe95d6 (patch)
treeb5cca24a823b34ea308672e9a27e9d483e7c2bed /patchtracker/views.py
parent47d6bf0d36ec31f8d3b28d331d91912a3c2d64cb (diff)
downloadpatch-tracker-b8f7b08f207b23998607771a66b12925d9fe95d6.tar.gz
Frontpage in django, and index view
Diffstat (limited to 'patchtracker/views.py')
-rw-r--r--patchtracker/views.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/patchtracker/views.py b/patchtracker/views.py
index b125681..0a316eb 100644
--- a/patchtracker/views.py
+++ b/patchtracker/views.py
@@ -66,3 +66,10 @@ def download_patch(request, patchType, package, version, patchName):
elif patchType == "series":
patch = pkg.diffhandler().series().fetch(patchName)
return django.http.HttpResponse(patch, mimetype="text/plain")
+
+def frontpage(request):
+ nonlibs = [idx for idx in models.SourcePackage.objects.filter(~django.db.models.Q(name__startswith='lib')).extra(select={'index' : "SUBSTR(name, 1, 1)"}).distinct().values_list('index', flat=True)]
+ libs = [idx for idx in models.SourcePackage.objects.filter(name__startswith='lib').extra(select={'index' : "SUBSTR(name, 1, 4)"}).distinct().values_list('index', flat=True)]
+ indices = sorted(nonlibs + libs)
+ extra = { 'indices':indices, 'conf':Conf }
+ return django.shortcuts.render_to_response('frontpage.html', extra)