From 5a76ff59fb47db47eab720f1545e649569e15dd7 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Wed, 13 Dec 2023 07:43:14 +0000 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=9D=A2=E6=9D=BF=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run_order/admin.py | 9 ++++++++- run_order/models.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) 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)