From: Ant Zucaro Date: Sun, 6 Nov 2016 00:17:50 +0000 (-0400) Subject: Get rid of joined_pretty_date in favor of the mixin. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmodels-refactor;p=xonotic%2Fxonstat.git Get rid of joined_pretty_date in favor of the mixin. --- diff --git a/xonstat/models/player.py b/xonstat/models/player.py index 5b7f97b..d9df075 100644 --- a/xonstat/models/player.py +++ b/xonstat/models/player.py @@ -8,7 +8,7 @@ from xonstat.models.mixins import FuzzyDateMixin, EpochMixin, NickColorsMixin from xonstat.util import strip_colors, pretty_date, qfont_decode -class Player(EpochMixin, NickColorsMixin): +class Player(EpochMixin, NickColorsMixin, FuzzyDateMixin): """ A player, which can represent either a human or a bot. """ @@ -19,10 +19,6 @@ class Player(EpochMixin, NickColorsMixin): else: return strip_colors(self.nick) - # TODO: use FuzzyDateMixin instead, but change the method calls - def joined_pretty_date(self): - return pretty_date(self.create_dt) - def __repr__(self): return "".format(self.player_id, self.nick.encode('utf-8')) diff --git a/xonstat/templates/player_index.mako b/xonstat/templates/player_index.mako index 6ef400f..c991f70 100644 --- a/xonstat/templates/player_index.mako +++ b/xonstat/templates/player_index.mako @@ -42,7 +42,7 @@ ${player.player_id} ${player.nick_html_colors()|n} - ${player.joined_pretty_date()} + ${player.fuzzy_date()} diff --git a/xonstat/templates/player_info.mako b/xonstat/templates/player_info.mako index 2d39e10..956d335 100644 --- a/xonstat/templates/player_info.mako +++ b/xonstat/templates/player_info.mako @@ -66,7 +66,7 @@
- Joined ${player.joined_pretty_date()} (player #${player.player_id}) + Joined ${player.fuzzy_date()} (player #${player.player_id}) % if cake_day: % endif diff --git a/xonstat/templates/search.mako b/xonstat/templates/search.mako index 45bf794..69013b0 100644 --- a/xonstat/templates/search.mako +++ b/xonstat/templates/search.mako @@ -110,7 +110,7 @@ ${player.player_id} ${player.nick_html_colors()|n} - ${player.joined_pretty_date()} + ${player.fuzzy_date()}