def list(request, program, platform): if not program in [x[0] for x in PROGRAM_CHOICES]: raise Http404('No such program %s.' % program) if not platform in [x[0] for x in PLATFORM_CHOICES]: raise Http404('No such platform %s.' % platform) if platform == 'win32': return redirect('downloads.views.list', program=program, platform='source') downloads = get_current_downloads(program, platform) stable_release, stable_downloads = downloads[0] try: testing_release, testing_downloads = downloads[1] except IndexError: testing_release, testing_downloads = (None, None) if stable_downloads.count() == 0: raise Http404('No such download option %s/%s.' % (program, platform)) for c in PLATFORM_CHOICES: if platform == c[0]: platform_name = c[1] result = render_to_response('downloads/list.html', RequestContext(request, { 'stable_release': stable_release, 'testing_release': testing_release, 'stable_downloads': stable_downloads, 'testing_downloads': testing_downloads, 'program_include': 'downloads/programs/%s-%s.html' % (program, platform), 'program': get_program(program), 'program_name': program, 'platform': platform_name, })) return result
def detail(request, program): if program not in (x[0] for x in PROGRAM_CHOICES): raise Http404("No such program %s." % program) downloads = get_current_downloads(program) stable_release, stable_downloads = downloads[0] try: testing_release, testing_downloads = downloads[1] except IndexError: testing_release, testing_downloads = (None, None) if stable_downloads.count() == 0: raise Http404("No such download option %s." % program) return render( request, "downloads/detail.html", { "stable_release": stable_release, "testing_release": testing_release, "stable_downloads": stable_downloads, "testing_downloads": testing_downloads, "program": get_program(program), "program_name": program, }, )
def release(request, program, version): release = get_object_or_404(Release, program=program, version=version) downloads = Download.objects.filter(release=release) if downloads.count() == 0: raise Http404('No such download option %s/%s.' % (program, version)) return render( request, 'downloads/release.html', { 'release': release, 'downloads': downloads, 'program': get_program(program), 'program_name': program, })
def release(request, program, version): release = get_object_or_404(Release, program = program, version = version) downloads = Download.objects.filter(release = release).order_by('location') if downloads.count() == 0: raise Http404('No such download option %s/%s.' % (program, version)) result = render(request, 'downloads/release.html', { 'release': release, 'downloads': downloads, 'program': get_program(program), 'program_name': program, }) return result
def release(request, program, version): release = get_object_or_404(Release, program=program, version=version) downloads = Download.objects.filter(release=release) if downloads.count() == 0: raise Http404(f"No such download option {program}/{version}.") return render( request, "downloads/release.html", { "release": release, "downloads": downloads, "program": get_program(program), "program_name": program, }, )
def program(request, program): if not program in [x[0] for x in PROGRAM_CHOICES]: raise Http404('No such program %s.' % program) if program in ['python-gammu']: raise Http404('No such program %s.' % program) stable_release, testing_release = get_latest_releases(program) downloads = get_current_downloads(program, 'source') return render_to_response('downloads/program.html', RequestContext(request, { 'stable_release': stable_release, 'testing_release': testing_release, 'platforms': PLATFORM_CHOICES[:1], 'downloads': downloads, 'program': get_program(program), 'program_name': program, }))
def release(request, program, version): release = get_object_or_404(Release, program = program, version = version) downloads = Download.objects.filter(release = release).order_by('location') if downloads.count() == 0: raise Http404('No such download option %s/%s.' % (program, version)) mirror, mirrors, set_mirror, mirror_id = get_mirrors(request) result = render_to_response('downloads/release.html', RequestContext(request, { 'release': release, 'downloads': downloads, 'program': get_program(program), 'mirrors': mirrors, 'mirror': mirror, })) if set_mirror: result.set_cookie('mirror', mirror_id, max_age = 3600 * 24 * 365) return result
def list(request, program, platform): if not program in [x[0] for x in PROGRAM_CHOICES]: raise Http404('No such program %s.' % program) if not platform in [x[0] for x in PLATFORM_CHOICES]: raise Http404('No such platform %s.' % platform) downloads = get_current_downloads(program, platform) stable_release, stable_downloads = downloads[0] try: testing_release, testing_downloads = downloads[1] except IndexError: testing_release, testing_downloads = (None, None) if stable_downloads.count() == 0: raise Http404('No such download option %s/%s.' % (program, platform)) mirror, mirrors, set_mirror, mirror_id = get_mirrors(request) for c in PLATFORM_CHOICES: if platform == c[0]: platform_name = c[1] result = render_to_response('downloads/list.html', RequestContext(request, { 'stable_release': stable_release, 'testing_release': testing_release, 'stable_downloads': stable_downloads, 'testing_downloads': testing_downloads, 'program_include': 'downloads/programs/%s-%s.html' % (program, platform), 'program': get_program(program), 'platform': platform_name, 'mirrors': mirrors, 'mirror': mirror, })) if set_mirror: result.set_cookie('mirror', mirror_id, max_age = 3600 * 24 * 365) return result
def detail(request, program): if not program in [x[0] for x in PROGRAM_CHOICES]: raise Http404('No such program %s.' % program) downloads = get_current_downloads(program) stable_release, stable_downloads = downloads[0] try: testing_release, testing_downloads = downloads[1] except IndexError: testing_release, testing_downloads = (None, None) if stable_downloads.count() == 0: raise Http404('No such download option %s.' % program) return render( request, 'downloads/detail.html', { 'stable_release': stable_release, 'testing_release': testing_release, 'stable_downloads': stable_downloads, 'testing_downloads': testing_downloads, 'program': get_program(program), 'program_name': program, })
def detail(request, program): if not program in [x[0] for x in PROGRAM_CHOICES]: raise Http404('No such program %s.' % program) downloads = get_current_downloads(program) stable_release, stable_downloads = downloads[0] try: testing_release, testing_downloads = downloads[1] except IndexError: testing_release, testing_downloads = (None, None) if stable_downloads.count() == 0: raise Http404('No such download option %s.' % program) result = render(request, 'downloads/detail.html', { 'stable_release': stable_release, 'testing_release': testing_release, 'stable_downloads': stable_downloads, 'testing_downloads': testing_downloads, 'program': get_program(program), 'program_name': program, }) return result