Ajout du champ 'shortname' à Games et Figurines

master
Olivier DOSSMANN 2018-01-15 19:07:19 +01:00
parent 91cc57f166
commit f2d7a2dfd8
2 changed files with 23 additions and 27 deletions

View File

@ -1,6 +1,6 @@
from django.contrib import admin
from django.utils.translation import ugettext as _
from figurines.models import Set, Figurine
from figurines.models import Figurine
from figurines.models import Set
class FigurineInline(admin.TabularInline):
@ -10,8 +10,8 @@ class FigurineInline(admin.TabularInline):
class SetAdmin(admin.ModelAdmin):
list_display = ('name',)
inlines = (FigurineInline,)
list_display = ('shortname', 'name')
inlines = (FigurineInline, )
admin.site.register(Set, SetAdmin)

View File

@ -1,7 +1,13 @@
from django.contrib import admin
from django.utils.translation import ugettext as _
from games.forms import GameForm
from games.models import Game, Platform, Timeline
from games.models import Game
from games.models import Platform
from games.models import Timeline
class PlatformAdmin(admin.ModelAdmin):
list_display = ('shortname', 'name')
class StatusFilter(admin.SimpleListFilter):
@ -28,34 +34,24 @@ class StatusFilter(admin.SimpleListFilter):
class GameAdmin(admin.ModelAdmin):
list_display = (
'name', 'playing', 'status', 'wish')
list_filter = [
StatusFilter,
'playing',
'wish']
search_fields = ('name',)
fieldsets = [
(_('Game Information'), {
'fields': [
('name', 'collection')]}),
(_('Progress'),
{'fields': [
('status'),
('note')]}),
('',
{'fields': [
('playing'), ('unplayed'), ('wish')]})
]
list_display = ('name', 'playing', 'status', 'wish')
list_filter = [StatusFilter, 'playing', 'wish']
search_fields = ('name', )
fieldsets = [(_('Game Information'), {
'fields': [('name', 'collection')]
}), (_('Progress'), {
'fields': [('status'), ('note')]
}), ('', {
'fields': [('playing'), ('unplayed'), ('wish')]
})]
form = GameForm
class TimelineAdmin(admin.ModelAdmin):
list_display = (
'date', 'status', 'item')
list_display = ('date', 'status', 'item')
admin.site.register(Platform)
admin.site.register(Platform, PlatformAdmin)
admin.site.register(Game, GameAdmin)
admin.site.register(Timeline, TimelineAdmin)