diff --git a/dr_botzo/countdown/models.py b/dr_botzo/countdown/models.py index 1f57d5f..6622b90 100644 --- a/dr_botzo/countdown/models.py +++ b/dr_botzo/countdown/models.py @@ -18,7 +18,7 @@ class CountdownItem(models.Model): created_time = models.DateTimeField(auto_now_add=True) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} @ {1:s}".format(self.name, timezone.localtime(self.at_time).strftime('%Y-%m-%d %H:%M:%S %Z')) diff --git a/dr_botzo/dispatch/models.py b/dr_botzo/dispatch/models.py index 9f20d42..eddb2a3 100644 --- a/dr_botzo/dispatch/models.py +++ b/dr_botzo/dispatch/models.py @@ -19,7 +19,7 @@ class Dispatcher(models.Model): ('send_message', "Can send messages to dispatchers"), ) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s}".format(self.key) @@ -42,7 +42,7 @@ class DispatcherAction(models.Model): destination = models.CharField(max_length=200) include_key = models.BooleanField(default=False) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} -> {1:s} {2:s}".format(self.dispatcher.key, self.type, self.destination) diff --git a/dr_botzo/facts/models.py b/dr_botzo/facts/models.py index fc87bd0..fd6de05 100644 --- a/dr_botzo/facts/models.py +++ b/dr_botzo/facts/models.py @@ -19,7 +19,7 @@ class FactCategory(models.Model): class Meta: verbose_name_plural = 'fact categories' - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s}".format(self.name) @@ -58,7 +58,7 @@ class Fact(models.Model): objects = FactManager() - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} - {1:s}".format(self.category.name, self.fact) diff --git a/dr_botzo/ircbot/models.py b/dr_botzo/ircbot/models.py index fa08a8c..e719a1e 100644 --- a/dr_botzo/ircbot/models.py +++ b/dr_botzo/ircbot/models.py @@ -29,7 +29,7 @@ class Alias(models.Model): class Meta: verbose_name_plural = "aliases" - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} -> {1:s}".format(self.pattern, self.replacement) @@ -54,7 +54,7 @@ class BotUser(models.Model): ('quit_bot', "Can tell the bot to quit via IRC"), ) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} (Django user {1:s})".format(self.nickmask, self.user.username) @@ -78,7 +78,7 @@ class IrcChannel(models.Model): ('manage_current_channels', "Can join/part channels via IRC"), ) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s}".format(self.name) @@ -97,7 +97,7 @@ class IrcPlugin(models.Model): ('manage_loaded_plugins', "Can load/unload plugins via IRC"), ) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s}".format(self.path) diff --git a/dr_botzo/karma/models.py b/dr_botzo/karma/models.py index aeadfea..5349e53 100644 --- a/dr_botzo/karma/models.py +++ b/dr_botzo/karma/models.py @@ -33,7 +33,7 @@ class KarmaKey(models.Model): objects = KarmaKeyManager() - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} ({1:d})".format(self.key, self.score()) @@ -84,7 +84,7 @@ class KarmaLogEntry(models.Model): class Meta: verbose_name_plural = 'karma log entries' - def __unicode__(self): + def __str__(self): """String representation.""" tz = pytz.timezone(settings.TIME_ZONE) diff --git a/dr_botzo/markov/models.py b/dr_botzo/markov/models.py index aca2fc5..560615f 100644 --- a/dr_botzo/markov/models.py +++ b/dr_botzo/markov/models.py @@ -17,7 +17,7 @@ class MarkovContext(models.Model): name = models.CharField(max_length=200, unique=True) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s}".format(self.name) @@ -32,7 +32,7 @@ class MarkovTarget(models.Model): chatter_chance = models.IntegerField(default=0) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} -> {1:s}".format(self.name, self.context.name) @@ -64,7 +64,7 @@ class MarkovState(models.Model): } unique_together = ('context', 'k1', 'k2', 'v') - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s},{1:s} -> {2:s} (count: {3:d})".format(self.k1, self.k2, self.v, self.count) diff --git a/dr_botzo/pi/models.py b/dr_botzo/pi/models.py index a063ac5..10e9548 100644 --- a/dr_botzo/pi/models.py +++ b/dr_botzo/pi/models.py @@ -54,7 +54,7 @@ class PiLog(models.Model): class Meta: get_latest_by = 'created' - def __unicode__(self): + def __str__(self): """String representation.""" tz = pytz.timezone(settings.TIME_ZONE) diff --git a/dr_botzo/races/models.py b/dr_botzo/races/models.py index a2ca591..c3d1062 100644 --- a/dr_botzo/races/models.py +++ b/dr_botzo/races/models.py @@ -17,7 +17,7 @@ class Race(models.Model): name = models.CharField(max_length=255) description = models.TextField() - def __unicode__(self): + def __str__(self): """Text representation of a race.""" return "{0:s} ({1:s})".format(self.name, self.key) @@ -37,7 +37,7 @@ class Racer(models.Model): class Meta: unique_together = ('nick', 'race') - def __unicode__(self): + def __str__(self): """Text representation of a race racer.""" return "{0:s} in {1:s}".format(self.nick, self.race.name) @@ -55,7 +55,7 @@ class RaceUpdate(models.Model): class Meta: ordering = ['event_time',] - def __unicode__(self): + def __str__(self): """Text representation of a race update.""" local_time = timezone.localtime(self.event_time) diff --git a/dr_botzo/seen/admin.py b/dr_botzo/seen/admin.py index 9ff9c9f..d73a082 100644 --- a/dr_botzo/seen/admin.py +++ b/dr_botzo/seen/admin.py @@ -4,7 +4,7 @@ from seen.models import SeenNick class SeenNickAdmin(admin.ModelAdmin): - list_display = ('__unicode__', 'seen_time') + list_display = ('__str__', 'seen_time') admin.site.register(SeenNick, SeenNickAdmin) diff --git a/dr_botzo/seen/models.py b/dr_botzo/seen/models.py index d1379ef..df40a29 100644 --- a/dr_botzo/seen/models.py +++ b/dr_botzo/seen/models.py @@ -17,7 +17,7 @@ class SeenNick(models.Model): ordering = ['-seen_time',] unique_together = ('nick', 'channel') - def __unicode__(self): + def __str__(self): """String representation of a seen nick.""" local_time = timezone.localtime(self.seen_time) diff --git a/dr_botzo/storycraft/models.py b/dr_botzo/storycraft/models.py index 770b7a8..680697b 100644 --- a/dr_botzo/storycraft/models.py +++ b/dr_botzo/storycraft/models.py @@ -34,7 +34,7 @@ class StorycraftGame(models.Model): start_time = models.DateTimeField(null=True) end_time = models.DateTimeField(null=True) - def __unicode__(self): + def __str__(self): """String representation.""" return "Storycraft game {0:d}: {1:s}; {2:s}".format(self.pk, self.summary(), self.get_progress_string()) @@ -93,7 +93,7 @@ class StorycraftPlayer(models.Model): nick = models.CharField(max_length=64) nickmask = models.CharField(max_length=200) - def __unicode__(self): + def __str__(self): """String representation.""" return "{0:s} in storycraft game {1:d}".format(self.nick, self.game.pk) @@ -108,7 +108,7 @@ class StorycraftLine(models.Model): line = models.TextField(default="") time = models.DateTimeField(auto_now_add=True) - def __unicode__(self): + def __str__(self): """String representation.""" return "line by {0:s} in storycraft game {1:d}".format(self.player.nick, self.game.pk)