summaryrefslogtreecommitdiffstats
path: root/mirrors/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-09-30 14:20:45 -0500
committerDan McGee <dan@archlinux.org>2010-09-30 14:20:45 -0500
commit3ebe31bdadfcb9c6571b250e53da1f7dd7ebeb66 (patch)
tree3698602e620e63dced2eec3afa85ca305cb7c644 /mirrors/models.py
parent6eb2ad2e17f86e5fd9e36efd7bc1eeb4910eee15 (diff)
downloadarchweb-3ebe31bdadfcb9c6571b250e53da1f7dd7ebeb66.tar.gz
archweb-3ebe31bdadfcb9c6571b250e53da1f7dd7ebeb66.zip
Add is_download field to mirror protocols
This will replace all the usages of '!= rsync' and 'is ftp or http' we have in the code with one check on a boolean flag. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/models.py')
-rw-r--r--mirrors/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mirrors/models.py b/mirrors/models.py
index 85423303..44f081e6 100644
--- a/mirrors/models.py
+++ b/mirrors/models.py
@@ -39,8 +39,12 @@ class Mirror(models.Model):
class MirrorProtocol(models.Model):
protocol = models.CharField(max_length=10, unique=True)
+ is_download = models.BooleanField(default=True,
+ help_text="Is protocol useful for end-users, e.g. FTP/HTTP")
+
def __unicode__(self):
return self.protocol
+
class Meta:
verbose_name = 'Mirror Protocol'
@@ -48,16 +52,20 @@ class MirrorUrl(models.Model):
url = models.CharField(max_length=255)
protocol = models.ForeignKey(MirrorProtocol, related_name="urls")
mirror = models.ForeignKey(Mirror, related_name="urls")
+
def __unicode__(self):
return self.url
+
class Meta:
verbose_name = 'Mirror URL'
class MirrorRsync(models.Model):
ip = models.CharField(max_length=24)
mirror = models.ForeignKey(Mirror, related_name="rsync_ips")
+
def __unicode__(self):
return "%s" % (self.ip)
+
class Meta:
verbose_name = 'Mirror Rsync IP'