Amélioration de l'interface d'ajout de jeux vidéos :

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
This commit is contained in:
Olivier DOSSMANN 2017-08-24 20:43:58 +02:00
parent 04708e6286
commit 5820bdc63a
3 changed files with 47 additions and 3 deletions

View File

@ -10,6 +10,14 @@ class GameAdmin(admin.ModelAdmin):
'playing', 'playing',
'wish'] 'wish']
search_fields = ('name',) search_fields = ('name',)
fields = [
'name',
'collection',
'status',
'playing',
'unplayed',
'wish'
]
class TimelineAdmin(admin.ModelAdmin): class TimelineAdmin(admin.ModelAdmin):

View File

@ -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."),
),
]

View File

@ -37,9 +37,15 @@ class Game(Item):
DEFAULT_CHOICE = UNFINISHED DEFAULT_CHOICE = UNFINISHED
# others # others
playing = models.BooleanField(default=False) playing = models.BooleanField(
unplayed = models.BooleanField(default=False) default=False,
wish = 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: class Meta:
ordering = ('-playing', 'name') ordering = ('-playing', 'name')