mower-data-collection/run_order/models.py
2023-12-13 07:43:14 +00:00

30 lines
822 B
Python

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 = [
(Proviso, "但书"),
(Tequila, "龙舌兰"),
]
version = models.ForeignKey(MowerVersion, on_delete=models.CASCADE)
uuid = models.ForeignKey(AnonymousUser, on_delete=models.CASCADE)
time = models.DateTimeField(auto_now_add=True)
facility_level = models.IntegerField()
skill = models.CharField(max_length=1, choices=SKILL_CHOICES)
grandet_mode = models.BooleanField()