fix #19 - Chronologies : ajout d'une colonne "Plateforme" et filtrage dessus
This commit is contained in:
parent
2db9340f3d
commit
2e7123989f
@ -81,8 +81,18 @@ class GameAdmin(admin.ModelAdmin):
|
||||
|
||||
|
||||
class TimelineAdmin(admin.ModelAdmin):
|
||||
list_display = ('date', 'status', 'item')
|
||||
list_display = ('date', 'status', 'item', 'get_platform')
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user