mower-data-collection/run_order/models.py

31 lines
822 B
Python
Raw Normal View History

2023-12-13 11:58:38 +08:00
from django.db import models
class MowerVersion(models.Model):
version = models.CharField(max_length=40, unique=True)
2023-12-13 15:43:14 +08:00
def __str__(self) -> str:
return self.version
2023-12-13 11:58:38 +08:00
class AnonymousUser(models.Model):
uuid = models.UUIDField(unique=True)
2023-12-13 15:43:14 +08:00
def __str__(self) -> str:
return str(self.uuid)
2023-12-13 11:58:38 +08:00
class RunOrder(models.Model):
2023-12-13 12:53:00 +08:00
Proviso = "p"
Tequila = "t"
SKILL_CHOICES = [
2023-12-13 15:43:14 +08:00
(Proviso, "但书"),
(Tequila, "龙舌兰"),
2023-12-13 12:53:00 +08:00
]
2023-12-13 11:58:38 +08:00
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()