diff options
author | Dan McGee <dan@archlinux.org> | 2012-09-25 04:13:02 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-09-25 04:13:02 +0200 |
commit | 05f309d7e57a66d9309abbf19b4328bad514b978 (patch) | |
tree | f7a934d04a911d88a6c3fa001eb872e50d36bb63 | |
parent | 8bf9147f47341d6efcad20931255888f7186bb7b (diff) | |
download | archweb-05f309d7e57a66d9309abbf19b4328bad514b978.tar.gz archweb-05f309d7e57a66d9309abbf19b4328bad514b978.tar.xz |
Add a new column to developer repo stats
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | devel/views.py | 5 | ||||
-rw-r--r-- | templates/devel/index.html | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/devel/views.py b/devel/views.py index 23ff9f7..ea85a90 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 488b675..a07a419 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -216,6 +216,7 @@ <th class="key">Repository</th> <th># Packages</th> <th># Flagged</th> + <th># Maintainers</th> </tr> </thead> <tbody> @@ -228,6 +229,8 @@ <td><a href="/packages/?repo={{ repo.name }}&flagged=Flagged" title="View all flagged packages in the {{ repo.name }} repository"> <strong>{{ repo.flagged_ct }}</strong> packages</a></td> + <td><strong>{{ repo.maintainer_ct }}</strong> maintainers</td> + </tr> </tr> {% endfor %} </tbody> |