Beispiel #1
0
def index(request):
    """The developer dashboard."""
    if request.user.is_authenticated():
        inner_q = PackageRelation.objects.filter(user=request.user)
    else:
        inner_q = PackageRelation.objects.none()
    inner_q = inner_q.values('pkgbase')

    flagged = Package.objects.normal().filter(
            flag_date__isnull=False, pkgbase__in=inner_q).order_by('pkgname')

    todopkgs = TodolistPackage.objects.select_related(
            'todolist', 'pkg', 'arch', 'repo').exclude(
            status=TodolistPackage.COMPLETE).filter(removed__isnull=True)
    todopkgs = todopkgs.filter(pkgbase__in=inner_q).order_by(
            'todolist__name', 'pkgname')

    todolists = get_annotated_todolists(incomplete_only=True)

    signoffs = sorted(get_signoff_groups(user=request.user),
            key=operator.attrgetter('pkgbase'))

    page_dict = {
            'todos': todolists,
            'flagged': flagged,
            'todopkgs': todopkgs,
            'signoffs': signoffs,
            'reports': available_reports(),
    }

    return render(request, 'devel/index.html', page_dict)
Beispiel #2
0
def index(request):
    """The developer dashboard."""
    if request.user.is_authenticated:
        inner_q = PackageRelation.objects.filter(user=request.user)
    else:
        inner_q = PackageRelation.objects.none()
    inner_q = inner_q.values('pkgbase')

    flagged = Package.objects.normal().filter(
        flag_date__isnull=False, pkgbase__in=inner_q).order_by('pkgname')

    todopkgs = TodolistPackage.objects.select_related(
        'todolist', 'pkg', 'arch', 'repo').exclude(
            status=TodolistPackage.COMPLETE).filter(removed__isnull=True)
    todopkgs = todopkgs.filter(pkgbase__in=inner_q).order_by(
        'todolist__name', 'pkgname')

    todolists = get_annotated_todolists(incomplete_only=True)

    signoffs = sorted(get_signoff_groups(user=request.user),
                      key=operator.attrgetter('pkgbase'))

    page_dict = {
        'todos': todolists,
        'flagged': flagged,
        'todopkgs': todopkgs,
        'signoffs': signoffs,
        'reports': available_reports(),
    }

    return render(request, 'devel/index.html', page_dict)
Beispiel #3
0
def index(request):
    '''the developer dashboard'''
    if (request.user.is_authenticated()):
        inner_q = PackageRelation.objects.filter(user=request.user)
    else:
        inner_q = PackageRelation.objects.none()
    inner_q = inner_q.values('pkgbase')

    flagged = Package.objects.normal().filter(
        flag_date__isnull=False, pkgbase__in=inner_q).order_by('pkgname')

    todopkgs = TodolistPkg.objects.select_related(
        'pkg', 'pkg__arch', 'pkg__repo').filter(complete=False)
    todopkgs = todopkgs.filter(pkg__pkgbase__in=inner_q).order_by(
        'list__name', 'pkg__pkgname')

    todolists = get_annotated_todolists(incomplete_only=True)

    signoffs = sorted(get_signoff_groups(user=request.user),
                      key=operator.attrgetter('pkgbase'))

    arches = Arch.objects.all().annotate(
        total_ct=Count('packages'), flagged_ct=Count('packages__flag_date'))
    repos = Repo.objects.all().annotate(
        total_ct=Count('packages'), flagged_ct=Count('packages__flag_date'))

    maintainers = get_annotated_maintainers()

    maintained = PackageRelation.objects.filter(
        type=PackageRelation.MAINTAINER).values('pkgbase')
    total_orphans = Package.objects.exclude(pkgbase__in=maintained).count()
    total_flagged_orphans = Package.objects.filter(
        flag_date__isnull=False).exclude(pkgbase__in=maintained).count()
    total_updated = Package.objects.filter(packager__isnull=True).count()
    orphan = {
        'package_count': total_orphans,
        'flagged_count': total_flagged_orphans,
        'updated_count': total_updated,
    }

    page_dict = {
        'todos': todolists,
        'arches': arches,
        'repos': repos,
        'maintainers': maintainers,
        'orphan': orphan,
        'flagged': flagged,
        'todopkgs': todopkgs,
        'signoffs': signoffs
    }

    return render(request, 'devel/index.html', page_dict)
Beispiel #4
0
def index(request):
    '''the developer dashboard'''
    if(request.user.is_authenticated()):
        inner_q = PackageRelation.objects.filter(user=request.user)
    else:
        inner_q = PackageRelation.objects.none()
    inner_q = inner_q.values('pkgbase')

    flagged = Package.objects.normal().filter(
            flag_date__isnull=False, pkgbase__in=inner_q).order_by('pkgname')

    todopkgs = TodolistPkg.objects.select_related(
            'pkg', 'pkg__arch', 'pkg__repo').filter(complete=False)
    todopkgs = todopkgs.filter(pkg__pkgbase__in=inner_q).order_by(
            'list__name', 'pkg__pkgname')

    todolists = get_annotated_todolists(incomplete_only=True)

    signoffs = sorted(get_signoff_groups(user=request.user),
            key=operator.attrgetter('pkgbase'))

    arches = Arch.objects.all().annotate(
            total_ct=Count('packages'), flagged_ct=Count('packages__flag_date'))
    repos = Repo.objects.all().annotate(
            total_ct=Count('packages'), flagged_ct=Count('packages__flag_date'))

    maintainers = get_annotated_maintainers()

    maintained = PackageRelation.objects.filter(
            type=PackageRelation.MAINTAINER).values('pkgbase')
    total_orphans = Package.objects.exclude(pkgbase__in=maintained).count()
    total_flagged_orphans = Package.objects.filter(
            flag_date__isnull=False).exclude(pkgbase__in=maintained).count()
    total_updated = Package.objects.filter(packager__isnull=True).count()
    orphan = {
            'package_count': total_orphans,
            'flagged_count': total_flagged_orphans,
            'updated_count': total_updated,
    }

    page_dict = {
            'todos': todolists,
            'arches': arches,
            'repos': repos,
            'maintainers': maintainers,
            'orphan': orphan,
            'flagged': flagged,
            'todopkgs': todopkgs,
            'signoffs': signoffs
    }

    return render(request, 'devel/index.html', page_dict)
Beispiel #5
0
def index(request):
    """The developer dashboard."""
    if request.user.is_authenticated():
        inner_q = PackageRelation.objects.filter(user=request.user)
    else:
        inner_q = PackageRelation.objects.none()
    inner_q = inner_q.values("pkgbase")

    flagged = Package.objects.normal().filter(flag_date__isnull=False, pkgbase__in=inner_q).order_by("pkgname")

    todopkgs = (
        TodolistPackage.objects.select_related("todolist", "pkg", "arch", "repo")
        .exclude(status=TodolistPackage.COMPLETE)
        .filter(removed__isnull=True)
    )
    todopkgs = todopkgs.filter(pkgbase__in=inner_q).order_by("todolist__name", "pkgname")

    todolists = get_annotated_todolists(incomplete_only=True)

    signoffs = sorted(get_signoff_groups(user=request.user), key=operator.attrgetter("pkgbase"))

    page_dict = {"todos": todolists, "flagged": flagged, "todopkgs": todopkgs, "signoffs": signoffs}

    return render(request, "devel/index.html", page_dict)