summaryrefslogtreecommitdiff
path: root/devel/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-03-27 16:15:20 -0500
committerDan McGee <dan@archlinux.org>2010-03-27 16:15:20 -0500
commitfe832ea845f07a79b4580f7bca1dcf44b2f215ee (patch)
treecbe8554621f84d4f40b4991b883571ad5d419888 /devel/views.py
parentf3b3117d1f0ee8862a0b47d6dfe9b20960dbb13e (diff)
Move package maintainer off of package model
This is an attempt to fix our long-standing problems dealing with maintainer information. Move the actual maintainer information off of the package model into a PackageRelation object, which has some flexibility to later represent more than just maintainership. This solves multiple problems: * If a package gets accidentally deleted, so did the maintainer info * Testing packages have always shown up as orphans * With split packages, it was easy to miss some of the sub-packages This commit does not include the deletion of the original maintainer column; that will come at a later time when I feel more confident that the data was migrated correctly. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/views.py')
-rw-r--r--devel/views.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/devel/views.py b/devel/views.py
index 4b278d16..045e60f7 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -5,10 +5,14 @@ from django.contrib.auth.models import User
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.mail import send_mail
+from django.db.models import Q
+
from main.models import Package, Todolist
from main.models import Arch, Repo
from main.models import UserProfile, News
from main.models import Mirror
+from packages.models import PackageRelation
+
import random
from string import ascii_letters, digits
pwletters = ascii_letters + digits
@@ -17,12 +21,15 @@ pwletters = ascii_letters + digits
@login_required
def index(request):
'''the Developer dashboard'''
+ inner_q = PackageRelation.objects.filter(user=request.user).values('pkgbase')
+ packages = Package.objects.select_related('arch', 'repo').filter(needupdate=True)
+ packages = packages.filter(Q(pkgname__in=inner_q) | Q(pkgbase__in=inner_q))
+
page_dict = {
'todos': Todolist.objects.incomplete(),
'repos': Repo.objects.all(), 'arches': Arch.objects.all(),
- 'maintainers': [
- User(id=None, username="orphan", first_name="Orphans")
- ] + list(User.objects.filter(is_active=True).order_by('last_name'))
+ 'maintainers': User.objects.filter(is_active=True).order_by('last_name'),
+ 'flagged' : packages,
}
return render_to_response('devel/index.html',