summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-15 22:50:14 +0200
committerDan McGee <dan@archlinux.org>2011-06-15 22:50:14 +0200
commit4a9b6867a3a2786435316ab7deefa54257bb931d (patch)
tree3b0cfc08238dcf6b67dac16b8c35bc26b14b213a /devel
parenteb231660b017eab886ecd98828bf0295e36a1112 (diff)
downloadarchweb-4a9b6867a3a2786435316ab7deefa54257bb931d.tar.gz
archweb-4a9b6867a3a2786435316ab7deefa54257bb931d.tar.xz
Refactor common select_related into manager method
For a Package object query, we almost always did .select_related('arch', 'repo). Refactor this into the manager as a 'normal()' method so we can avoid sprinkling the same logic everywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/devel/views.py b/devel/views.py
index 2b8bd43..1827f2a 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -32,7 +32,7 @@ from string import ascii_letters, digits
def index(request):
'''the developer dashboard'''
inner_q = PackageRelation.objects.filter(user=request.user).values('pkgbase')
- flagged = Package.objects.select_related('arch', 'repo').filter(
+ flagged = Package.objects.normal().filter(
flag_date__isnull=False, pkgbase__in=inner_q).order_by('pkgname')
todopkgs = TodolistPkg.objects.select_related(
@@ -135,7 +135,7 @@ def change_profile(request):
@login_required
def report(request, report, username=None):
title = 'Developer Report'
- packages = Package.objects.select_related('arch', 'repo')
+ packages = Package.objects.normal()
names = attrs = user = None
if report == 'old':