diff options
author | Dan McGee <dan@archlinux.org> | 2011-08-17 07:57:41 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-17 07:57:41 -0500 |
commit | a489f355ec52dd54946bc7476615aa7cab9e384c (patch) | |
tree | d4fc7feb1c529ebe01273801ce8fa1b838509a91 | |
parent | 7954617a0593632d749d7e8b60beab2aae1669ba (diff) |
Implement get_absolute_url for Iso model
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | releng/models.py | 4 | ||||
-rw-r--r-- | templates/releng/iso_overview.html | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/releng/models.py b/releng/models.py index ceac948b..3afef55e 100644 --- a/releng/models.py +++ b/releng/models.py @@ -1,3 +1,4 @@ +from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import pre_save @@ -48,6 +49,9 @@ class Iso(models.Model): removed = models.DateTimeField(null=True, blank=True, default=None) active = models.BooleanField(default=True) + def get_absolute_url(self): + return reverse('releng-results-iso', args=[self.pk]) + def __unicode__(self): return self.name diff --git a/templates/releng/iso_overview.html b/templates/releng/iso_overview.html index ee3aaed3..054e0fa7 100644 --- a/templates/releng/iso_overview.html +++ b/templates/releng/iso_overview.html @@ -19,9 +19,7 @@ {% for iso in isos %} <tr> <td> - <a href="{% url releng-results-iso iso.pk %}"> - {{ iso.name }} - </a> + <a href="{{ iso.get_absolute_url }}">{{ iso.name }}</a> </td> <td> {{ iso.active|yesno }} |