summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2008-03-23 05:01:16 +0100
committereliott <eliott@cactuswax.net>2008-03-23 05:01:16 +0100
commitce564d73a6758e6ce8e15f39e47ea67910274a7d (patch)
tree9e507656074df007e5adb8c86bd3c293b26b5241 /devel
parentf41fc770e4151f7556011afcb990095f98d5b879 (diff)
downloadarchweb-ce564d73a6758e6ce8e15f39e47ea67910274a7d.tar.gz
archweb-ce564d73a6758e6ce8e15f39e47ea67910274a7d.tar.xz
Added the ability to see flagged packages only, per use or repo
Diffstat (limited to 'devel')
-rw-r--r--devel/views.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/devel/views.py b/devel/views.py
index 6684361..f243d7d 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -23,29 +23,36 @@ def index(request):
stats = Package.objects.get_flag_stats()
if thismaint:
# get list of flagged packages for this maintainer
- pkgs = Package.objects.filter(maintainer=thismaint.id).filter(needupdate=True).order_by('repo', 'pkgname')
+ pkgs = Package.objects.filter(
+ maintainer=thismaint.id).filter(
+ needupdate=True).order_by('repo', 'pkgname')
else:
pkgs = None
+
arch_stats = []
- for arch in Arch.objects.all():
+ for arch_name in Package.ARCHES:
+ arch = Package.ARCHES[arch_name]
arch_stats.append({
- 'name': arch.name,
+ 'name': arch_name,
'count': Package.objects.filter(arch__exact = arch).count(),
- 'flagged': Package.objects.filter(arch__exact = arch).filter(needupdate=True).count()
+ 'flagged': Package.objects.filter(
+ arch__exact = arch).filter(needupdate=True).count()
})
repo_stats = []
- for repo in Package.REPOS:
+ for repo_name in Package.REPOS:
+ repo = Package.REPOS[repo_name]
repo_stats.append({
- 'name': repo,
- 'count': Package.objects.filter(repo = Package.REPOS[repo]).count(),
- 'flagged': Package.objects.filter(Package.REPOS[repo]).filter(needupdate=True).count()
+ 'name': repo_name,
+ 'count': Package.objects.filter(repo__exact = repo).count(),
+ 'flagged': Package.objects.filter(
+ repo__exact = repo).filter(needupdate=True).count()
})
return render_response(
request, 'devel/index.html',
{'stats': stats, 'pkgs': pkgs, 'todos': todos, 'maint': thismaint,
- 'repos': repo_stats, 'archs': arch_stats})
+ 'repos': repo_stats, 'arches': arch_stats})
@login_required
#@is_maintainer