コード例 #1
0
ファイル: views.py プロジェクト: lavish205/olympia
def version_list(request, addon, template, beta=False):
    status_list = (amo.STATUS_BETA,) if beta else amo.VALID_STATUSES
    qs = addon.versions.filter(files__status__in=status_list).distinct().order_by("-created")
    versions = amo.utils.paginate(request, qs, PER_PAGE)
    versions.object_list = list(versions.object_list)
    Version.transformer(versions.object_list)
    return render(request, template, {"addon": addon, "beta": beta, "versions": versions})
コード例 #2
0
ファイル: views.py プロジェクト: tsl143/addons-server
def version_list(request, addon, beta=False):
    qs = _version_list_qs(addon, beta=beta)
    versions = amo.utils.paginate(request, qs, PER_PAGE)
    versions.object_list = list(versions.object_list)
    Version.transformer(versions.object_list)
    return render(request, 'versions/version_list.html', {
        'addon': addon, 'beta': beta, 'versions': versions})
コード例 #3
0
def version_list(request, addon, template, beta=False):
    status_list = (amo.STATUS_BETA,) if beta else amo.VALID_FILE_STATUSES
    qs = (addon.versions.filter(files__status__in=status_list)
          .distinct().order_by('-created'))
    versions = amo.utils.paginate(request, qs, PER_PAGE)
    versions.object_list = list(versions.object_list)
    Version.transformer(versions.object_list)
    return render(request, template, {'addon': addon, 'beta': beta,
                                      'versions': versions})
コード例 #4
0
def version_list(request, addon, beta=False):
    qs = _version_list_qs(addon, beta=beta)
    versions = amo.utils.paginate(request, qs, PER_PAGE)
    versions.object_list = list(versions.object_list)
    Version.transformer(versions.object_list)
    return render(request, 'versions/version_list.html', {
        'addon': addon,
        'beta': beta,
        'versions': versions
    })
コード例 #5
0
def version_list(request, addon, template, beta=False):
    status_list = (amo.STATUS_BETA,) if beta else amo.VALID_FILE_STATUSES
    qs = (addon.versions.filter(channel=amo.RELEASE_CHANNEL_LISTED)
          .filter(files__status__in=status_list)
          .distinct().order_by('-created'))
    versions = amo.utils.paginate(request, qs, PER_PAGE)
    versions.object_list = list(versions.object_list)
    Version.transformer(versions.object_list)
    return render(request, template, {'addon': addon, 'beta': beta,
                                      'versions': versions})
コード例 #6
0
ファイル: views.py プロジェクト: vijeth-aradhya/addons-server
def version_list(request, addon, template, beta=False):
    # We only show versions that have files with the right status.
    if beta:
        status = amo.STATUS_BETA
    elif addon.is_unreviewed():
        status = amo.STATUS_AWAITING_REVIEW
    else:
        status = amo.STATUS_PUBLIC
    qs = (addon.versions.filter(channel=amo.RELEASE_CHANNEL_LISTED).filter(
        files__status=status).distinct().order_by('-created'))
    versions = amo.utils.paginate(request, qs, PER_PAGE)
    versions.object_list = list(versions.object_list)
    Version.transformer(versions.object_list)
    return render(request, template, {
        'addon': addon,
        'beta': beta,
        'versions': versions
    })