Compare commits

...

2 commits

Author SHA1 Message Date
d0c
6c3ce23e0e sample match-case 2023-01-20 16:47:00 +01:00
d0c
1e8f05304a model upgrade 2023-01-20 16:45:23 +01:00
2 changed files with 18 additions and 11 deletions

View file

@ -25,6 +25,9 @@ class Command(BaseCommand):
data = yaml.safe_load(stream)
dev = Device()
for key, value in data.items():
#match caso:
# case dict():
# print('dict')
if key == "bluetooth":
# get() returned more than one Bluetooth -- it returned 2!
bt = Bluetooth.objects.filter(**value)

View file

@ -23,40 +23,44 @@ class Camera(models.Model):
class Device(models.Model):
architecture = models.JSONField(default=dict)
battery = models.JSONField(default=dict)
architecture = models.CharField(max_length=100)
before_install = models.JSONField(default=dict) # dict or str
before_install = models.JSONField(default=dict, null=True) # dict or str
bluetooth = models.ForeignKey(Bluetooth, on_delete=models.CASCADE)
cameras = models.ManyToManyField(Camera)
cpu = models.CharField(max_length=100)
codename = models.CharField(max_length=100)
cpu_cores = models.CharField(max_length=100)
cpu = models.CharField(max_length=100)
cpu_cores = models.IntegerField(default=1)
cpu_freq = models.CharField(max_length=100)
current_branch = models.FloatField(default=None)
download_boot = models.CharField(max_length=100)
dimensions = models.CharField(max_length=100)
custom_recovery_link = models.URLField(max_length=200, null=True)
download_boot = models.CharField(max_length=200)
dimensions = models.JSONField(default=dict, null=True)
gpu = models.CharField(max_length=100)
image = models.CharField(max_length=100)
install_method = models.CharField(max_length=100)
is_ab_device = models.BooleanField(null=True)
kernel = models.CharField(max_length=100)
maintainers = ArrayField(models.CharField(max_length=100), default=None)
device_models = ArrayField(models.CharField(max_length=100), default=None)
peripherals = ArrayField(models.CharField(max_length=100), default=None)
name = models.CharField(max_length=100)
recovery_boot = models.CharField(max_length=100)
network = ArrayField(models.CharField(max_length=100), default=None)
peripherals = ArrayField(models.CharField(max_length=100), default=None)
ram = models.CharField(max_length=100)
recovery_boot = models.CharField(max_length=100)
recovery_reboot = models.CharField(max_length=100)
release = models.CharField(max_length=100)
release = models.DateField()
screen = models.JSONField(default=dict) # dict or str
sdcard = models.JSONField(default=dict) # dict or str{1}
storage = models.CharField(max_length=100)
soc = models.CharField(max_length=100)
storage = models.CharField(max_length=100)
tree = models.CharField(max_length=100)
device_type = models.CharField(max_length=100)
uses_twrp = models.BooleanField(null=True)
vendor = models.CharField(max_length=100)
vendor_short = models.CharField(max_length=100)
versions = ArrayField(models.FloatField(default=None), default=None)
wifi = models.CharField(max_length=100)
wifi = models.CharField(max_length=200, null=True)
def __str__(self):
return 'Device: ' + self.name