diff options
Diffstat (limited to 'releng/views.py')
-rw-r--r-- | releng/views.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/releng/views.py b/releng/views.py index dbb65c2e..7db469cd 100644 --- a/releng/views.py +++ b/releng/views.py @@ -13,7 +13,7 @@ from django.views.generic import DetailView, ListView from .models import (Architecture, BootType, Bootloader, ClockChoice, Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source, Test, Release) - +from mirrors.models import (Mirror, MirrorUrl, MirrorProtocol) def standard_field(model, empty_label=None, help_text=None, required=True): return forms.ModelChoiceField(queryset=model.objects.all(), @@ -280,4 +280,23 @@ def releases_json(request): response = HttpResponse(to_json, content_type='application/json') return response +def netboot_config(request): + release_qs = Release.objects.filter(available=True).order_by('-release_date') + releases = [ release.version for release in release_qs ] + mirrorurls = MirrorUrl.objects.filter(protocol__protocol='http', + active=True, + mirror__public=True, + mirror__active=True, + mirror__isos=True) + mirrorurls = sorted( mirrorurls, + key=lambda x: x.mirror.name) + mirrorurls = sorted( mirrorurls, + key=lambda x: x.country.name) + context = { + 'archs': [ 'i686', 'x86_64' ], + 'releases': releases, + 'mirrorurls': mirrorurls, + } + return render(request, "releng/archlinux.ipxe", context, content_type='text/plain') + # vim: set ts=4 sw=4 et: |