From 5820bdc63ad1b607500f8a105d99faf9e2070c3a Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Thu, 24 Aug 2017 20:43:58 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20de=20l'interface=20d'ajout?= =?UTF-8?q?=20de=20jeux=20vid=C3=A9os=20:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modification de : * ajout de champs d'aide sur les champs booléens * création des fichiers de migration pour ces champs d'aide * choix de l'ordre des champs dans l'interface admin de Games --- collection/games/admin.py | 8 +++++ .../migrations/0002_auto_20170824_1843.py | 30 +++++++++++++++++++ collection/games/models.py | 12 ++++++-- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 collection/games/migrations/0002_auto_20170824_1843.py diff --git a/collection/games/admin.py b/collection/games/admin.py index 961c6a7..8bb2921 100644 --- a/collection/games/admin.py +++ b/collection/games/admin.py @@ -10,6 +10,14 @@ class GameAdmin(admin.ModelAdmin): 'playing', 'wish'] search_fields = ('name',) + fields = [ + 'name', + 'collection', + 'status', + 'playing', + 'unplayed', + 'wish' + ] class TimelineAdmin(admin.ModelAdmin): diff --git a/collection/games/migrations/0002_auto_20170824_1843.py b/collection/games/migrations/0002_auto_20170824_1843.py new file mode 100644 index 0000000..f832bd2 --- /dev/null +++ b/collection/games/migrations/0002_auto_20170824_1843.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11 on 2017-08-24 18:43 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('games', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='game', + name='playing', + field=models.BooleanField(default=False, help_text="You're currently playing this game."), + ), + migrations.AlterField( + model_name='game', + name='unplayed', + field=models.BooleanField(default=False, help_text='You never played this game.'), + ), + migrations.AlterField( + model_name='game', + name='wish', + field=models.BooleanField(default=False, help_text="You're waiting X-mas father offers you this game."), + ), + ] diff --git a/collection/games/models.py b/collection/games/models.py index e06e134..51a8cfc 100644 --- a/collection/games/models.py +++ b/collection/games/models.py @@ -37,9 +37,15 @@ class Game(Item): DEFAULT_CHOICE = UNFINISHED # others - playing = models.BooleanField(default=False) - unplayed = models.BooleanField(default=False) - wish = models.BooleanField(default=False) + playing = models.BooleanField( + default=False, + help_text=_('You\'re currently playing this game.')) + unplayed = models.BooleanField( + default=False, + help_text=_('You never played this game.')) + wish = models.BooleanField( + default=False, + help_text=_('You\'re waiting X-mas father offers you this game.')) class Meta: ordering = ('-playing', 'name')