diff options
author | Frank Vanderham <fvanderham@ontracksconsulting.com> | 2018-04-22 14:14:23 -0600 |
---|---|---|
committer | Jelle van der Waa <jelle@vdwaa.nl> | 2019-01-21 21:19:58 +0100 |
commit | 0ca04132d084ad510662f4c64a4fa8ef92d289da (patch) | |
tree | cf393b260b4fbedd8f7013964a78c8d9cd89888a /mirrors | |
parent | 4dc419db90ee98ac5996f75c1bad8b99435a0302 (diff) | |
download | archweb-0ca04132d084ad510662f4c64a4fa8ef92d289da.tar.gz archweb-0ca04132d084ad510662f4c64a4fa8ef92d289da.zip |
Refactor Python 3 __unicode__ to __str__
In Python 3 for Django, class method __unicode__ must be changed to
__str__. This commit replaces all models that use __unicode__ to
__str__.
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/models.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mirrors/models.py b/mirrors/models.py index 4215d872..1f27f30a 100644 --- a/mirrors/models.py +++ b/mirrors/models.py @@ -38,7 +38,7 @@ class Mirror(models.Model): class Meta: ordering = ('name',) - def __unicode__(self): + def __str__(self): return self.name def downstream(self): @@ -60,7 +60,7 @@ class MirrorProtocol(models.Model): help_text="Included by default when building mirror list?") created = models.DateTimeField(editable=False) - def __unicode__(self): + def __str__(self): return self.protocol class Meta: @@ -84,7 +84,7 @@ class MirrorUrl(models.Model): class Meta: verbose_name = 'mirror URL' - def __unicode__(self): + def __str__(self): return self.url def address_families(self): @@ -127,7 +127,7 @@ class MirrorRsync(models.Model): mirror = models.ForeignKey(Mirror, related_name="rsync_ips", on_delete=models.CASCADE) created = models.DateTimeField(editable=False) - def __unicode__(self): + def __str__(self): return unicode(self.ip) class Meta: @@ -145,7 +145,7 @@ class CheckLocation(models.Model): class Meta: ordering = ('hostname', 'source_ip') - def __unicode__(self): + def __str__(self): return self.hostname @property @@ -182,7 +182,7 @@ class MirrorLog(models.Model): return timedelta() return self.check_time - self.last_sync - def __unicode__(self): + def __str__(self): return "Check of %s at %s" % (self.url.url, self.check_time) class Meta: |