summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-30 21:45:05 +0100
committerDan McGee <dan@archlinux.org>2011-11-30 21:45:05 +0100
commit025042ef0d23378a5f10fe1cff8f660f51638615 (patch)
treea05d09566c2fd320fbfa5c72e210f047e79ebc26
parent7c84bea7dabdfbc307d373620b00214777d91a97 (diff)
downloadarchweb-025042ef0d23378a5f10fe1cff8f660f51638615.tar.gz
archweb-025042ef0d23378a5f10fe1cff8f660f51638615.tar.xz
Master keys: reduce query count, add default ordering
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--devel/models.py3
-rw-r--r--public/views.py3
2 files changed, 5 insertions, 1 deletions
diff --git a/devel/models.py b/devel/models.py
index ea0f4d5..f31b8fb 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 95b590f..4051261 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)