From f590a365c351a96f254c5a388dac9628fec64d37 Mon Sep 17 00:00:00 2001 From: parruc Date: Tue, 3 Jan 2023 11:02:23 +0100 Subject: [PATCH] Aggiorna 'suitablephones/models.py' --- suitablephones/models.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/suitablephones/models.py b/suitablephones/models.py index e51b9f9..493891d 100644 --- a/suitablephones/models.py +++ b/suitablephones/models.py @@ -2,12 +2,29 @@ from django.db import models # Create your models here. + +class Bluetooth(models.Model): + spec = models.CharField(max_lengh=100) + profile = models.CharField(max_lengh=100) + + +class Camera(models.Model): + class FLASHES(models.TextChoices: + LED = 'L', 'Led' + DUAL_LED = 'DL', 'Double Led' + + megapixel = models.DecimalField() + flash = models.CharField(max_lengh=100, choices=FLASH) + +#Devices.object.filter(flash=Camera.FLASEHS.LED) + + class Device(models.Model): #battery = architecture = models.CharField(max_length=100) #before_install = - #bluetooth = - #cameras = + bluetooth = modle.ForeingKey(Bluetooth) + cameras = models.ManyToManyField(Camera) cpu = models.CharField(max_length=100) codename = models.CharField(max_length=100) cpu_cores = models.CharField(max_length=100)