diff options
author | Dan McGee <dan@archlinux.org> | 2012-04-25 01:32:57 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-25 01:51:58 -0500 |
commit | 640e0f58645a7fd07f3c6185d9583b4d218e2468 (patch) | |
tree | 46323cbe3549b7d60a7b88eacb702522982b2a27 /mirrors/models.py | |
parent | 20675141c340ea3d2d6d8305f8ba0950d3bf974c (diff) |
Finish django countries implementation
* Add a migration to drop the old countries field.
* Update all templates/views/utility methods to point at the new country
field and dereference it as necessary.
* Add the flags images to a few views where it makes sense.
* Cleanup the download page layout quite a bit.
* Bump the mirror status JSON version to 3; add country_code attribute.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/models.py')
-rw-r--r-- | mirrors/models.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mirrors/models.py b/mirrors/models.py index 79968412..c23622fa 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -25,8 +25,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_old = models.CharField(max_length=255, db_index=True) - country = CountryField(blank=True) + country = CountryField(blank=True, db_index=True) admin_email = models.EmailField(max_length=255, blank=True) public = models.BooleanField(default=True) active = models.BooleanField(default=True) @@ -70,9 +69,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_old = NullCharField(max_length=255, null=True, blank=True, - db_index=True) - country = CountryField(blank=True) + country = CountryField(blank=True, db_index=True) has_ipv4 = models.BooleanField("IPv4 capable", default=True, editable=False) has_ipv6 = models.BooleanField("IPv6 capable", default=False, @@ -90,7 +87,7 @@ class MirrorUrl(models.Model): @property def real_country(self): - return self.country_old or self.mirror.country_old + return self.country or self.mirror.country def clean(self): try: |