diff options
author | Dan McGee <dan@archlinux.org> | 2014-09-01 23:16:44 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-09-01 23:16:44 +0200 |
commit | a8ceba34299cca271ddf433bf7618aa98e56cc36 (patch) | |
tree | 18b60a477ad4d6126823902ce132d86e2954bd32 /mirrors | |
parent | 9335d3330b2cee8065cbd46eb71a7ebc50b4b037 (diff) | |
download | archweb-a8ceba34299cca271ddf433bf7618aa98e56cc36.tar.gz archweb-a8ceba34299cca271ddf433bf7618aa98e56cc36.tar.xz |
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/models.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mirrors/models.py b/mirrors/models.py index 4113222..e360801 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -75,6 +75,12 @@ class MirrorUrl(models.Model): created = models.DateTimeField(editable=False) active = models.BooleanField(default=True) + class Meta: + verbose_name = 'mirror URL' + + def __unicode__(self): + return self.url + def address_families(self): hostname = urlparse(self.url).hostname info = socket.getaddrinfo(hostname, None, 0, socket.SOCK_STREAM) @@ -101,11 +107,8 @@ class MirrorUrl(models.Model): self.has_ipv4 = False self.has_ipv6 = False - def __unicode__(self): - return self.url - - class Meta: - verbose_name = 'mirror URL' + def get_absolute_url(self): + return '/mirrors/%s/%d/' % (self.mirror.name, self.pk) class MirrorRsync(models.Model): |