diff --git a/run_order/admin.py b/run_order/admin.py index 85f1660..3ad0ffb 100644 --- a/run_order/admin.py +++ b/run_order/admin.py @@ -5,7 +5,14 @@ from .models import RunOrder, AnonymousUser, MowerVersion @admin.register(RunOrder) class RunOrderAdmin(admin.ModelAdmin): - pass + list_display = [ + "version", + "uuid", + "time", + "facility_level", + "skill", + "grandet_mode", + ] @admin.register(AnonymousUser) diff --git a/run_order/models.py b/run_order/models.py index 3f65bc0..d67fc45 100644 --- a/run_order/models.py +++ b/run_order/models.py @@ -4,17 +4,23 @@ from django.db import models class MowerVersion(models.Model): version = models.CharField(max_length=40, unique=True) + def __str__(self) -> str: + return self.version + class AnonymousUser(models.Model): uuid = models.UUIDField(unique=True) + def __str__(self) -> str: + return str(self.uuid) + class RunOrder(models.Model): Proviso = "p" Tequila = "t" SKILL_CHOICES = [ - ("p", "但书"), - ("t", "龙舌兰"), + (Proviso, "但书"), + (Tequila, "龙舌兰"), ] version = models.ForeignKey(MowerVersion, on_delete=models.CASCADE) uuid = models.ForeignKey(AnonymousUser, on_delete=models.CASCADE)