Пример #1
0
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
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
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
    })