fix #19 - Chronologies : ajout d'une colonne "Plateforme" et filtrage dessus

This commit is contained in:
Olivier DOSSMANN 2018-02-04 21:27:43 +01:00
parent 2db9340f3d
commit 2e7123989f

View File

@ -81,8 +81,18 @@ class GameAdmin(admin.ModelAdmin):
class TimelineAdmin(admin.ModelAdmin): class TimelineAdmin(admin.ModelAdmin):
list_display = ('date', 'status', 'item') list_display = ('date', 'status', 'item', 'get_platform')
search_fields = ('item__name', ) search_fields = ('item__name', )
list_filter = ('item__collection__shortname', )
def get_platform(self, obj):
"""
Display platform shortname
"""
return obj.item.collection.shortname
get_platform.short_description = _('Platform')
get_platform.admin_order_field = ('item__collection__shortname')
admin.site.register(Platform, PlatformAdmin) admin.site.register(Platform, PlatformAdmin)