Improvements and driver stub for serial comms

This commit is contained in:
2021-12-16 23:11:22 +01:00
parent c5b8a75f3b
commit 5bab2243bf
7 changed files with 97 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
from uuid import uuid4
from django.db import models
from django_countries.fields import CountryField
# from django.core.files.storage import FileSystemStorage
# from django.dispatch import receiver
@@ -21,13 +22,15 @@ class Manufacturer(models.Model):
class Company(models.Model):
name = models.CharField(max_length=128, unique=True)
country = models.CharField(max_length=128, unique=True)
country = CountryField()
class Meta:
verbose_name_plural = "Companies"
def __str__(self):
return self.name
class Decoder(models.Model):
name = models.CharField(max_length=128, unique=True)
manufacturer = models.ForeignKey(
@@ -50,6 +53,9 @@ class Cab(models.Model):
decoder = models.ForeignKey(
Decoder, on_delete=models.CASCADE,
null=True, blank=True)
company = models.ForeignKey(
Company, on_delete=models.CASCADE,
null=True, blank=True)
epoch = models.CharField(max_length=32, blank=True)
production_year = models.SmallIntegerField(null=True, blank=True)
purchase_date = models.DateField(null=True, blank=True)