コード例 #1
0
def releases(request=None):

    latest = Release.objects.filter(stable=True)[0]
    if Release.objects.filter(stable=False).exists():
        beta = Release.objects.filter(stable=False)[0]
        if beta.version_num < latest.version_num:
            beta = None
    else:
        beta = None

    return {
        'latest_release': latest,
        'beta_release': beta,
        'releases': get_current_releases(),
        'all_releases': Release.objects.all(),
    }
コード例 #2
0
def releases(request=None):

    latest = Release.objects.filter(stable=True)[0]
    if Release.objects.filter(stable=False).exists():
        beta = Release.objects.filter(stable=False)[0]
        if beta.version_num < latest.version_num:
            beta = None
    else:
        beta = None

    return {
        'latest_release': latest,
        'beta_release': beta,
        'releases': get_current_releases(),
        'all_releases': Release.objects.all(),
    }
コード例 #3
0
ファイル: views.py プロジェクト: phpmyadmin/website
def version_json(request):
    latest = Release.objects.filter(stable=True)[0]
    response = {
        'version': latest.version,
        'date': latest.date.date().isoformat(),
        'releases': [],
    }
    for release in get_current_releases():
        response['releases'].append({
            'version': release.version,
            'date': release.date.date().isoformat(),
            'php_versions': release.get_php_versions(),
            'mysql_versions': release.get_mysql_versions(),
        })
    return HttpResponse(
        json.dumps(response, indent=4),
        content_type='application/json'
    )
コード例 #4
0
ファイル: views.py プロジェクト: rajakedia1/website
def version_json(request):
    latest = Release.objects.filter(stable=True)[0]
    response = {
        'version': latest.version,
        'date': latest.date.date().isoformat(),
        'releases': [],
    }
    for release in get_current_releases():
        response['releases'].append({
            'version':
            release.version,
            'date':
            release.date.date().isoformat(),
            'php_versions':
            release.get_php_versions(),
            'mysql_versions':
            release.get_mysql_versions(),
        })
    return HttpResponse(json.dumps(response, indent=4),
                        content_type='application/json')