From 05f309d7e57a66d9309abbf19b4328bad514b978 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 24 Sep 2012 21:13:02 -0500 Subject: Add a new column to developer repo stats Signed-off-by: Dan McGee --- devel/views.py | 5 +++++ templates/devel/index.html | 3 +++ 2 files changed, 8 insertions(+) diff --git a/devel/views.py b/devel/views.py index 23ff9f74..ea85a901 100644 --- a/devel/views.py +++ b/devel/views.py @@ -55,6 +55,11 @@ def index(request): total_ct=Count('packages'), flagged_ct=Count('packages__flag_date')) repos = Repo.objects.all().annotate( total_ct=Count('packages'), flagged_ct=Count('packages__flag_date')) + # the join is huge unless we do this separately, so merge the result here + repo_maintainers = dict(Repo.objects.all().values_list('id').annotate( + Count('userprofile'))) + for repo in repos: + repo.maintainer_ct = repo_maintainers.get(repo.id, 0) maintainers = get_annotated_maintainers() diff --git a/templates/devel/index.html b/templates/devel/index.html index 488b6755..a07a4190 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -216,6 +216,7 @@

Stats by Repository

Repository # Packages # Flagged + # Maintainers @@ -228,6 +229,8 @@

Stats by Repository

{{ repo.flagged_ct }} packages + {{ repo.maintainer_ct }} maintainers + {% endfor %} -- cgit v1.2.3-54-g00ecf