From 6b8ef446bcd6a1cbc794d0846968e806034d3aad Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 30 Nov 2011 13:55:36 -0600 Subject: Add master key overview page And a bunch of text that may suck, but is better than nothing. Signed-off-by: Dan McGee --- public/views.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'public/views.py') diff --git a/public/views.py b/public/views.py index c28fd303..95b590fc 100644 --- a/public/views.py +++ b/public/views.py @@ -1,17 +1,17 @@ -from main.models import Arch, Repo, Donor -from mirrors.models import MirrorUrl -from news.models import News -from . import utils - from django.conf import settings from django.contrib.auth.models import User from django.http import Http404 from django.views.generic import list_detail from django.views.generic.simple import direct_to_template +from devel.models import MasterKey +from main.models import Arch, Repo, Donor +from mirrors.models import MirrorUrl +from news.models import News +from utils import get_recent_updates def index(request): - pkgs = utils.get_recent_updates() + pkgs = get_recent_updates() context = { 'news_updates': News.objects.order_by('-postdate', '-id')[:15], 'pkg_updates': pkgs, @@ -77,4 +77,10 @@ def feeds(request): } return direct_to_template(request, 'public/feeds.html', context) +def keys(request): + context = { + 'keys': MasterKey.objects.select_related('owner', 'revoker').all(), + } + return direct_to_template(request, 'public/keys.html', context) + # vim: set ts=4 sw=4 et: -- cgit v1.2.3-54-g00ecf From 025042ef0d23378a5f10fe1cff8f660f51638615 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 30 Nov 2011 14:45:05 -0600 Subject: Master keys: reduce query count, add default ordering Signed-off-by: Dan McGee --- devel/models.py | 3 +++ public/views.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'public/views.py') diff --git a/devel/models.py b/devel/models.py index ea0f4d55..f31b8fbb 100644 --- a/devel/models.py +++ b/devel/models.py @@ -14,4 +14,7 @@ class MasterKey(models.Model): created = models.DateTimeField() revoked = models.DateTimeField(null=True, blank=True) + class Meta: + ordering = ('created',) + # vim: set ts=4 sw=4 et: diff --git a/public/views.py b/public/views.py index 95b590fc..40512614 100644 --- a/public/views.py +++ b/public/views.py @@ -79,7 +79,8 @@ def feeds(request): def keys(request): context = { - 'keys': MasterKey.objects.select_related('owner', 'revoker').all(), + 'keys': MasterKey.objects.select_related('owner', 'revoker', + 'owner__userprofile', 'revoker__userprofile').all(), } return direct_to_template(request, 'public/keys.html', context) -- cgit v1.2.3-54-g00ecf