change __unicode__()s to __str__()s
This commit is contained in:
parent
9112ad0ae7
commit
47a1352a0a
@ -18,7 +18,7 @@ class CountdownItem(models.Model):
|
|||||||
|
|
||||||
created_time = models.DateTimeField(auto_now_add=True)
|
created_time = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} @ {1:s}".format(self.name, timezone.localtime(self.at_time).strftime('%Y-%m-%d %H:%M:%S %Z'))
|
return "{0:s} @ {1:s}".format(self.name, timezone.localtime(self.at_time).strftime('%Y-%m-%d %H:%M:%S %Z'))
|
||||||
|
@ -19,7 +19,7 @@ class Dispatcher(models.Model):
|
|||||||
('send_message', "Can send messages to dispatchers"),
|
('send_message', "Can send messages to dispatchers"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s}".format(self.key)
|
return "{0:s}".format(self.key)
|
||||||
@ -42,7 +42,7 @@ class DispatcherAction(models.Model):
|
|||||||
destination = models.CharField(max_length=200)
|
destination = models.CharField(max_length=200)
|
||||||
include_key = models.BooleanField(default=False)
|
include_key = models.BooleanField(default=False)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} -> {1:s} {2:s}".format(self.dispatcher.key, self.type, self.destination)
|
return "{0:s} -> {1:s} {2:s}".format(self.dispatcher.key, self.type, self.destination)
|
||||||
|
@ -19,7 +19,7 @@ class FactCategory(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
verbose_name_plural = 'fact categories'
|
verbose_name_plural = 'fact categories'
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s}".format(self.name)
|
return "{0:s}".format(self.name)
|
||||||
@ -58,7 +58,7 @@ class Fact(models.Model):
|
|||||||
|
|
||||||
objects = FactManager()
|
objects = FactManager()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} - {1:s}".format(self.category.name, self.fact)
|
return "{0:s} - {1:s}".format(self.category.name, self.fact)
|
||||||
|
@ -29,7 +29,7 @@ class Alias(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
verbose_name_plural = "aliases"
|
verbose_name_plural = "aliases"
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} -> {1:s}".format(self.pattern, self.replacement)
|
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"),
|
('quit_bot', "Can tell the bot to quit via IRC"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} (Django user {1:s})".format(self.nickmask, self.user.username)
|
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"),
|
('manage_current_channels', "Can join/part channels via IRC"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s}".format(self.name)
|
return "{0:s}".format(self.name)
|
||||||
@ -97,7 +97,7 @@ class IrcPlugin(models.Model):
|
|||||||
('manage_loaded_plugins', "Can load/unload plugins via IRC"),
|
('manage_loaded_plugins', "Can load/unload plugins via IRC"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s}".format(self.path)
|
return "{0:s}".format(self.path)
|
||||||
|
@ -33,7 +33,7 @@ class KarmaKey(models.Model):
|
|||||||
|
|
||||||
objects = KarmaKeyManager()
|
objects = KarmaKeyManager()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} ({1:d})".format(self.key, self.score())
|
return "{0:s} ({1:d})".format(self.key, self.score())
|
||||||
@ -84,7 +84,7 @@ class KarmaLogEntry(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
verbose_name_plural = 'karma log entries'
|
verbose_name_plural = 'karma log entries'
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
tz = pytz.timezone(settings.TIME_ZONE)
|
tz = pytz.timezone(settings.TIME_ZONE)
|
||||||
|
@ -17,7 +17,7 @@ class MarkovContext(models.Model):
|
|||||||
|
|
||||||
name = models.CharField(max_length=200, unique=True)
|
name = models.CharField(max_length=200, unique=True)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s}".format(self.name)
|
return "{0:s}".format(self.name)
|
||||||
@ -32,7 +32,7 @@ class MarkovTarget(models.Model):
|
|||||||
|
|
||||||
chatter_chance = models.IntegerField(default=0)
|
chatter_chance = models.IntegerField(default=0)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} -> {1:s}".format(self.name, self.context.name)
|
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')
|
unique_together = ('context', 'k1', 'k2', 'v')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s},{1:s} -> {2:s} (count: {3:d})".format(self.k1, self.k2, self.v, self.count)
|
return "{0:s},{1:s} -> {2:s} (count: {3:d})".format(self.k1, self.k2, self.v, self.count)
|
||||||
|
@ -54,7 +54,7 @@ class PiLog(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
get_latest_by = 'created'
|
get_latest_by = 'created'
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
tz = pytz.timezone(settings.TIME_ZONE)
|
tz = pytz.timezone(settings.TIME_ZONE)
|
||||||
|
@ -17,7 +17,7 @@ class Race(models.Model):
|
|||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
description = models.TextField()
|
description = models.TextField()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Text representation of a race."""
|
"""Text representation of a race."""
|
||||||
|
|
||||||
return "{0:s} ({1:s})".format(self.name, self.key)
|
return "{0:s} ({1:s})".format(self.name, self.key)
|
||||||
@ -37,7 +37,7 @@ class Racer(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ('nick', 'race')
|
unique_together = ('nick', 'race')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Text representation of a race racer."""
|
"""Text representation of a race racer."""
|
||||||
|
|
||||||
return "{0:s} in {1:s}".format(self.nick, self.race.name)
|
return "{0:s} in {1:s}".format(self.nick, self.race.name)
|
||||||
@ -55,7 +55,7 @@ class RaceUpdate(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['event_time',]
|
ordering = ['event_time',]
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Text representation of a race update."""
|
"""Text representation of a race update."""
|
||||||
|
|
||||||
local_time = timezone.localtime(self.event_time)
|
local_time = timezone.localtime(self.event_time)
|
||||||
|
@ -4,7 +4,7 @@ from seen.models import SeenNick
|
|||||||
|
|
||||||
|
|
||||||
class SeenNickAdmin(admin.ModelAdmin):
|
class SeenNickAdmin(admin.ModelAdmin):
|
||||||
list_display = ('__unicode__', 'seen_time')
|
list_display = ('__str__', 'seen_time')
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(SeenNick, SeenNickAdmin)
|
admin.site.register(SeenNick, SeenNickAdmin)
|
||||||
|
@ -17,7 +17,7 @@ class SeenNick(models.Model):
|
|||||||
ordering = ['-seen_time',]
|
ordering = ['-seen_time',]
|
||||||
unique_together = ('nick', 'channel')
|
unique_together = ('nick', 'channel')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation of a seen nick."""
|
"""String representation of a seen nick."""
|
||||||
|
|
||||||
local_time = timezone.localtime(self.seen_time)
|
local_time = timezone.localtime(self.seen_time)
|
||||||
|
@ -34,7 +34,7 @@ class StorycraftGame(models.Model):
|
|||||||
start_time = models.DateTimeField(null=True)
|
start_time = models.DateTimeField(null=True)
|
||||||
end_time = models.DateTimeField(null=True)
|
end_time = models.DateTimeField(null=True)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "Storycraft game {0:d}: {1:s}; {2:s}".format(self.pk, self.summary(), self.get_progress_string())
|
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)
|
nick = models.CharField(max_length=64)
|
||||||
nickmask = models.CharField(max_length=200)
|
nickmask = models.CharField(max_length=200)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "{0:s} in storycraft game {1:d}".format(self.nick, self.game.pk)
|
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="")
|
line = models.TextField(default="")
|
||||||
time = models.DateTimeField(auto_now_add=True)
|
time = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""String representation."""
|
||||||
|
|
||||||
return "line by {0:s} in storycraft game {1:d}".format(self.player.nick, self.game.pk)
|
return "line by {0:s} in storycraft game {1:d}".format(self.player.nick, self.game.pk)
|
||||||
|
Loading…
Reference in New Issue
Block a user