summaryrefslogtreecommitdiff
path: root/releng
diff options
context:
space:
mode:
Diffstat (limited to 'releng')
-rw-r--r--releng/models.py3
-rw-r--r--releng/urls.py6
-rw-r--r--releng/views.py13
3 files changed, 21 insertions, 1 deletions
diff --git a/releng/models.py b/releng/models.py
index 9f091371..8bc54def 100644
--- a/releng/models.py
+++ b/releng/models.py
@@ -127,6 +127,9 @@ class Release(models.Model):
def __unicode__(self):
return self.version
+ def get_absolute_url(self):
+ return reverse('releng-release-detail', args=[self.version])
+
def dir_path(self):
return "iso/%s/" % self.version
diff --git a/releng/urls.py b/releng/urls.py
index 8d1b8f24..8413d318 100644
--- a/releng/urls.py
+++ b/releng/urls.py
@@ -1,5 +1,7 @@
from django.conf.urls import include, patterns
+from .views import ReleaseListView, ReleaseDetailView
+
feedback_patterns = patterns('releng.views',
(r'^$', 'test_results_overview', {}, 'releng-test-overview'),
(r'^submit/$', 'submit_test_result', {}, 'releng-test-submit'),
@@ -11,5 +13,9 @@ feedback_patterns = patterns('releng.views',
urlpatterns = patterns('',
(r'^feedback/', include(feedback_patterns)),
+ (r'^releases/$',
+ ReleaseListView.as_view(), {}, 'releng-release-list'),
+ (r'^releases/(?P<version>[-.\w]+)/$',
+ ReleaseDetailView.as_view(), {}, 'releng-release-detail'),
)
# vim: set ts=4 sw=4 et:
diff --git a/releng/views.py b/releng/views.py
index 67b3cb4a..6c49275f 100644
--- a/releng/views.py
+++ b/releng/views.py
@@ -3,10 +3,11 @@ from django.conf import settings
from django.db.models import Count, Max
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
+from django.views.generic import DetailView, ListView
from .models import (Architecture, BootType, Bootloader, ClockChoice,
Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source,
- Test)
+ Test, Release)
def standard_field(model, empty_label=None, help_text=None, required=True):
@@ -213,4 +214,14 @@ def iso_overview(request):
}
return render(request, 'releng/iso_overview.html', context)
+
+class ReleaseListView(ListView):
+ model = Release
+
+
+class ReleaseDetailView(DetailView):
+ model = Release
+ slug_field = 'version'
+ slug_url_kwarg = 'version'
+
# vim: set ts=4 sw=4 et: