From c70673b8b1d3a8666ae92247f792b7759d5dd534 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Mon, 15 Jan 2018 21:13:49 +0100 Subject: [PATCH] Liste des jeux : ajout d'une colonne pour le nom de la plateforme --- .../locale/fr/LC_MESSAGES/django.po | 2 +- .../conf/locale/fr/LC_MESSAGES/django.po | 20 +++++++++++-------- collection/games/admin.py | 11 +++++++++- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/collection/collection/locale/fr/LC_MESSAGES/django.po b/collection/collection/locale/fr/LC_MESSAGES/django.po index e481e34..cf8df6d 100644 --- a/collection/collection/locale/fr/LC_MESSAGES/django.po +++ b/collection/collection/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-15 17:37+0000\n" +"POT-Creation-Date: 2018-01-15 20:10+0000\n" "PO-Revision-Date: 2017-09-16 17:16+0200\n" "Last-Translator: Olivier DOSSMANN \n" "Language-Team: \n" diff --git a/collection/conf/locale/fr/LC_MESSAGES/django.po b/collection/conf/locale/fr/LC_MESSAGES/django.po index 55a266d..1c86ce4 100644 --- a/collection/conf/locale/fr/LC_MESSAGES/django.po +++ b/collection/conf/locale/fr/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-15 17:37+0000\n" -"PO-Revision-Date: 2018-01-15 18:38+0100\n" +"POT-Creation-Date: 2018-01-15 20:10+0000\n" +"PO-Revision-Date: 2018-01-15 21:10+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -17,11 +17,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.5\n" -#: core/models.py:7 core/models.py:29 +#: core/models.py:8 core/models.py:28 msgid "name" msgstr "nom" -#: core/models.py:8 +#: core/models.py:9 msgid "shortname" msgstr "nom court" @@ -29,11 +29,11 @@ msgstr "nom court" msgid "New" msgstr "Nouveau" -#: core/models.py:49 core/models.py:81 +#: core/models.py:48 core/models.py:79 msgid "status" msgstr "état" -#: core/models.py:66 +#: core/models.py:65 msgid "date" msgstr "date" @@ -69,11 +69,11 @@ msgstr "Collection d'où cela provient" msgid "Figurine progression" msgstr "Progression de la figurine" -#: games/admin.py:11 +#: games/admin.py:17 msgid "state" msgstr "état" -#: games/admin.py:39 +#: games/admin.py:40 msgid "Game Information" msgstr "Information du jeu" @@ -81,6 +81,10 @@ msgstr "Information du jeu" msgid "Progress" msgstr "Progression" +#: games/admin.py:56 +msgid "Platform" +msgstr "Plateforme" + #: games/models.py:15 games/models.py:29 msgid "platform" msgstr "plateforme" diff --git a/collection/games/admin.py b/collection/games/admin.py index 12d474d..4c455e0 100644 --- a/collection/games/admin.py +++ b/collection/games/admin.py @@ -34,7 +34,7 @@ class StatusFilter(admin.SimpleListFilter): class GameAdmin(admin.ModelAdmin): - list_display = ('name', 'playing', 'status', 'wish') + list_display = ('name', 'get_platform', 'playing', 'status', 'wish') list_filter = [StatusFilter, 'playing', 'wish'] search_fields = ('name', ) fieldsets = [(_('Game Information'), { @@ -47,6 +47,15 @@ class GameAdmin(admin.ModelAdmin): form = GameForm + def get_platform(self, obj): + """ + Display platform shortname + """ + return obj.collection.shortname + + get_platform.short_description = _('Platform') + get_platform.admin_order_field = 'collection__shortname' + class TimelineAdmin(admin.ModelAdmin): list_display = ('date', 'status', 'item')