From 4cc17e77a0db2be0a0f75d65861c3557f6845408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Sat, 20 Jun 2026 09:00:37 +0200 Subject: [PATCH] feat(scores): add into django-admin --- highscore/scores/admin.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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"]