Esempio n. 1
0
def name_search_json(request):
    if 'terms' not in request.GET:
        raise Http404()

    links = DownloadLink.objects.filter(hidden=False)

    for term in request.GET['terms'].split():
        links = links.filter(name__icontains=term)

    return json_response(links)
Esempio n. 2
0
def json_release_link_search(request, release_id):
    release = get_object_or_404(Release, pk=release_id)

    if 'terms' not in request.GET:
        raise Http404()

    links = DownloadLink.objects.filter(hidden=False).exclude(release=release)

    for term in request.GET['terms'].split():
        links = links.filter(name__icontains=term)

    return json_response(links)
Esempio n. 3
0
def json_release_link_search(request, release_id):
    release = get_object_or_404(Release, pk=release_id)

    if 'terms' not in request.GET:
        raise Http404()

    links = DownloadLink.objects.filter(hidden=False).exclude(release=release)

    for term in request.GET['terms'].split():
        links = links.filter(name__icontains=term)

    return json_response(links)
Esempio n. 4
0
def json_release_children(request, release_id):
    release = get_object_or_404(Release, pk=release_id)

    return json_response(release.downloadlink_set.all(), ('name', ))
Esempio n. 5
0
def json_release_children(request, release_id):
    release = get_object_or_404(Release, pk=release_id)

    return json_response(release.downloadlink_set.all(), ('name',))