diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/models.py | 20 |
1 files changed, 14 insertions, 6 deletions
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 |