管理面板优化

This commit is contained in:
zhbaor 2023-12-13 07:43:14 +00:00
parent 14a5729e06
commit 5a76ff59fb
2 changed files with 16 additions and 3 deletions

View file

@ -5,7 +5,14 @@ from .models import RunOrder, AnonymousUser, MowerVersion
@admin.register(RunOrder) @admin.register(RunOrder)
class RunOrderAdmin(admin.ModelAdmin): class RunOrderAdmin(admin.ModelAdmin):
pass list_display = [
"version",
"uuid",
"time",
"facility_level",
"skill",
"grandet_mode",
]
@admin.register(AnonymousUser) @admin.register(AnonymousUser)

View file

@ -4,17 +4,23 @@ from django.db import models
class MowerVersion(models.Model): class MowerVersion(models.Model):
version = models.CharField(max_length=40, unique=True) version = models.CharField(max_length=40, unique=True)
def __str__(self) -> str:
return self.version
class AnonymousUser(models.Model): class AnonymousUser(models.Model):
uuid = models.UUIDField(unique=True) uuid = models.UUIDField(unique=True)
def __str__(self) -> str:
return str(self.uuid)
class RunOrder(models.Model): class RunOrder(models.Model):
Proviso = "p" Proviso = "p"
Tequila = "t" Tequila = "t"
SKILL_CHOICES = [ SKILL_CHOICES = [
("p", "但书"), (Proviso, "但书"),
("t", "龙舌兰"), (Tequila, "龙舌兰"),
] ]
version = models.ForeignKey(MowerVersion, on_delete=models.CASCADE) version = models.ForeignKey(MowerVersion, on_delete=models.CASCADE)
uuid = models.ForeignKey(AnonymousUser, on_delete=models.CASCADE) uuid = models.ForeignKey(AnonymousUser, on_delete=models.CASCADE)