diff options
author | Dan McGee <dan@archlinux.org> | 2012-04-24 23:22:23 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-25 00:00:36 -0500 |
commit | 116751e4bab183b3cca93ab13f7f4f21c752be4e (patch) | |
tree | 4eff5a95519b85352e92516f33bf1897dc90a8a8 /mirrors/models.py | |
parent | 206000df736fde75a49c3178a8522d17f30a955e (diff) |
Rename mirror country fields to country_old in prep for normalization
We're going to move to using ISO 2 character codes via django countries,
so start by moving the old data out of the way first.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/models.py')
-rw-r--r-- | mirrors/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mirrors/models.py b/mirrors/models.py index 86905eea..46753fac 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -24,7 +24,7 @@ class Mirror(models.Model): name = models.CharField(max_length=255, unique=True) tier = models.SmallIntegerField(default=2, choices=TIER_CHOICES) upstream = models.ForeignKey('self', null=True, on_delete=models.SET_NULL) - country = models.CharField(max_length=255, db_index=True) + country_old = models.CharField(max_length=255, db_index=True) admin_email = models.EmailField(max_length=255, blank=True) public = models.BooleanField(default=True) active = models.BooleanField(default=True) @@ -34,7 +34,7 @@ class Mirror(models.Model): notes = models.TextField(blank=True) class Meta: - ordering = ('country', 'name') + ordering = ('country_old', 'name') def __unicode__(self): return self.name @@ -68,7 +68,7 @@ class MirrorUrl(models.Model): protocol = models.ForeignKey(MirrorProtocol, related_name="urls", editable=False, on_delete=models.PROTECT) mirror = models.ForeignKey(Mirror, related_name="urls") - country = NullCharField(max_length=255, null=True, blank=True, + country_old = NullCharField(max_length=255, null=True, blank=True, db_index=True) has_ipv4 = models.BooleanField("IPv4 capable", default=True, editable=False) @@ -87,7 +87,7 @@ class MirrorUrl(models.Model): @property def real_country(self): - return self.country or self.mirror.country + return self.country_old or self.mirror.country_old def clean(self): try: |