diff --git a/highscore/scores/admin.py b/highscore/scores/admin.py index 846f6b4..20f08c4 100644 --- a/highscore/scores/admin.py +++ b/highscore/scores/admin.py @@ -1 +1,19 @@ -# Register your models here. +from django.contrib import admin + +from scores.models import Score, Version + + +@admin.register(Version) +class VersionAdmin(admin.ModelAdmin): + list_display = ["name", "created_at"] + search_fields = ["name"] + ordering = ["-created_at"] + + +@admin.register(Score) +class ScoreAdmin(admin.ModelAdmin): + list_display = ["username", "points", "version", "created_at"] + list_filter = ["version"] + search_fields = ["username"] + list_select_related = ["version"] + ordering = ["-points"]