summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-27 08:59:00 -0500
committerDan McGee <dan@archlinux.org>2012-04-27 09:12:26 -0500
commitdc94eade03022ce3a5286f5e781576321a5f1653 (patch)
tree604b10eaba12f066fa6a843a4f5342a89eb11fb5 /devel
parent3f150dcfade9443b3435309cb928f330966eb749 (diff)
downloadarchweb-dc94eade03022ce3a5286f5e781576321a5f1653.tar.gz
archweb-dc94eade03022ce3a5286f5e781576321a5f1653.zip
Incomplete-only todolists optimization
We can push this down to the database if we know in advance we only need the incomplete lists. This helps our call on the developer dashboard quite a bit; the time of the single query in question drops from >1300ms to around 40ms. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/views.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/devel/views.py b/devel/views.py
index d2ce65db..39f28a65 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -49,8 +49,7 @@ def index(request):
todopkgs = todopkgs.filter(pkg__pkgbase__in=inner_q).order_by(
'list__name', 'pkg__pkgname')
- todolists = get_annotated_todolists()
- todolists = [todolist for todolist in todolists if todolist.incomplete_count > 0]
+ todolists = get_annotated_todolists(incomplete_only=True)
signoffs = sorted(get_signoff_groups(user=request.user),
key=operator.attrgetter('pkgbase'))