コード例 #1
0
ファイル: views.py プロジェクト: yetilinux/yetiweb
def public_list(request):
    todo_lists = Todolist.objects.incomplete()
    # total hackjob, but it makes this a lot less query-intensive.
    all_pkgs = [tp for tl in todo_lists for tp in tl.packages]
    attach_maintainers([tp.pkg for tp in all_pkgs])
    return direct_to_template(request, "todolists/public_list.html",
            {"todo_lists": todo_lists})
コード例 #2
0
ファイル: views.py プロジェクト: Acidburn0zzz/Web-Archweb
def public_list(request):
    todo_lists = Todolist.objects.incomplete()
    # total hackjob, but it makes this a lot less query-intensive.
    all_pkgs = [tp for tl in todo_lists for tp in tl.packages]
    attach_maintainers([tp.pkg for tp in all_pkgs])
    return render(request, "todolists/public_list.html",
                  {"todo_lists": todo_lists})
コード例 #3
0
ファイル: views.py プロジェクト: yetilinux/yetiweb
def view(request, list_id):
    todolist = get_object_or_404(Todolist, id=list_id)
    svn_roots = Repo.objects.order_by().values_list(
            'svn_root', flat=True).distinct()
    # we don't hold onto the result, but the objects are the same here,
    # so accessing maintainers in the template is now cheap
    attach_maintainers(tp.pkg for tp in todolist.packages)
    return direct_to_template(request, 'todolists/view.html', {
        'list': todolist,
        'svn_roots': svn_roots,
    })
コード例 #4
0
ファイル: views.py プロジェクト: archhurd/archweb
def view(request, list_id):
    todolist = get_object_or_404(Todolist, id=list_id)
    svn_roots = Repo.objects.values_list("svn_root", flat=True).order_by().distinct()
    # we don't hold onto the result, but the objects are the same here,
    # so accessing maintainers in the template is now cheap
    attach_maintainers(tp.pkg for tp in todolist.packages)
    arches = set(tp.pkg.arch for tp in todolist.packages)
    repos = set(tp.pkg.repo for tp in todolist.packages)
    return render(
        request,
        "todolists/view.html",
        {"list": todolist, "svn_roots": svn_roots, "arches": sorted(arches), "repos": sorted(repos)},
    )
コード例 #5
0
ファイル: views.py プロジェクト: Acidburn0zzz/Web-Archweb
def view(request, list_id):
    todolist = get_object_or_404(Todolist, id=list_id)
    svn_roots = Repo.objects.values_list('svn_root',
                                         flat=True).order_by().distinct()
    # we don't hold onto the result, but the objects are the same here,
    # so accessing maintainers in the template is now cheap
    attach_maintainers(tp.pkg for tp in todolist.packages)
    arches = set(tp.pkg.arch for tp in todolist.packages)
    repos = set(tp.pkg.repo for tp in todolist.packages)
    return render(
        request, 'todolists/view.html', {
            'list': todolist,
            'svn_roots': svn_roots,
            'arches': sorted(arches),
            'repos': sorted(repos),
        })
コード例 #6
0
ファイル: views.py プロジェクト: timofonic-archlinux/archweb
def view(request, slug):
    todolist = get_object_or_404(Todolist, slug=slug)
    svn_roots = Repo.objects.values_list(
            'svn_root', flat=True).order_by().distinct()
    # we don't hold onto the result, but the objects are the same here,
    # so accessing maintainers in the template is now cheap
    attach_maintainers(todolist.packages())
    attach_staging(todolist.packages(), todolist.pk)
    arches = {tp.arch for tp in todolist.packages()}
    repos = {tp.repo for tp in todolist.packages()}
    context = {
        'list': todolist,
        'svn_roots': svn_roots,
        'arches': sorted(arches),
        'repos': sorted(repos),
    }
    return render(request, 'todolists/view.html', context)