From fe832ea845f07a79b4580f7bca1dcf44b2f215ee Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 27 Mar 2010 16:15:20 -0500 Subject: 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 --- devel/views.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'devel') diff --git a/devel/views.py b/devel/views.py index 4b278d1..045e60f 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', -- cgit v1.2.3-24-g4f1b