From 5f48dda94b593feefd906a7aa495427c870d6db9 Mon Sep 17 00:00:00 2001 From: eliott Date: Sat, 5 Apr 2008 13:27:10 -0700 Subject: Fix for FS#9554 Backported and modified from 'master' --- devel/views.py | 5 ++++- main/models.py | 20 ++++++++++++++------ templates/devel/index.html | 4 ++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/devel/views.py b/devel/views.py index f243d7d0..cbeaf156 100644 --- a/devel/views.py +++ b/devel/views.py @@ -36,7 +36,10 @@ def index(request): 'name': arch_name, 'count': Package.objects.filter(arch__exact = arch).count(), 'flagged': Package.objects.filter( - arch__exact = arch).filter(needupdate=True).count() + arch__exact = arch).filter(needupdate=True).count(), + 'flagnotest': Package.objects.filter( + arch__exact = arch).filter(needupdate=True).exclude( + repo=Package.REPOS['testing']).count() }) repo_stats = [] diff --git a/main/models.py b/main/models.py index 74f2cdbf..525a4ceb 100644 --- a/main/models.py +++ b/main/models.py @@ -70,14 +70,22 @@ class PackageManager(models.Manager): def get_flag_stats(self): results = [] # first the orphans - unflagged = self.filter(maintainer=0).count() - flagged = self.filter(maintainer=0).filter(needupdate=True).count() - results.append((User(id=0,first_name='Orphans'), unflagged, flagged)) + noflag = self.filter(maintainer=0).count() + flagged = self.filter(maintainer=0).filter(needupdate=True).count() + flagnotest = self.filter(maintainer=0).filter( + needupdate=True).exclude( + repo=Package.REPOS['testing']).count() + results.append( + (User(id=0,first_name='Orphans'), noflag, flagged, flagnotest)) # now the rest for maint in User.objects.all().order_by('first_name'): - unflagged = self.filter(maintainer=maint.id).count() - flagged = self.filter(maintainer=maint.id).filter(needupdate=True).count() - results.append((maint, unflagged, flagged)) + noflag = self.filter(maintainer=maint.id).count() + flagged = self.filter(maintainer=maint.id).filter( + needupdate=True).count() + flagnotest = self.filter(maintainer=maint.id).filter( + needupdate=True).exclude( + repo=Package.REPOS['testing']).count() + results.append((maint, noflag, flagged, flagnotest)) return results diff --git a/templates/devel/index.html b/templates/devel/index.html index 91055376..d993e3b8 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -29,12 +29,14 @@

Stats by Architecture

Arch # Packages # Flagged + # Flagnotest {% for arch in arches %} {{ arch.name }} {{ arch.count }} packages {{ arch.flagged }} packages + {{ arch.flagnotest }} packages {% endfor %} @@ -66,12 +68,14 @@

Stats by Maintainer

Maintainer # Packages # Flagged + # Flagnotest {% for maint in stats %} {{ maint.0.get_full_name }} {{ maint.1 }} packages {{ maint.2 }} packages + {{ maint.3 }} packages {% endfor %} -- cgit v1.2.3-54-g00ecf