feat: alteração no db

This commit is contained in:
2024-12-20 09:40:33 -03:00
parent a91fe5abf6
commit dfb7418e7a
224 changed files with 35465 additions and 3 deletions

View File

@@ -5,7 +5,6 @@ from products.models import Product
from mesas.models import Mesa
from typePay.models import TypePay
# Create your models here.
class Comanda(models.Model):
id = models.AutoField(primary_key=True)
mesa = models.ForeignKey(Mesa, on_delete=models.CASCADE)
@@ -14,6 +13,7 @@ class Comanda(models.Model):
dt_close = models.DateTimeField(null=True, blank=True)
client = models.ForeignKey(Client, on_delete=models.SET_NULL, null=True, blank=True)
name = models.CharField(max_length=255)
status = models.CharField(max_length=255, default="OPEN")
def __str__(self) -> str:
return self.name
@@ -21,7 +21,7 @@ class ProductComanda(models.Model):
id = models.AutoField(primary_key=True)
comanda = models.ForeignKey(Comanda, on_delete=models.CASCADE)
data_time = models.DateTimeField(auto_now_add=True)
product = models.ForeignKey(Product, on_delete=models.CASCADE)
product = models.ForeignKey(Product, on_delete=models.PROTECT)
applicant = models.CharField(max_length=255, null=True, blank=True)
def __str__(self) -> str:
return self.comanda.name + " - " + self.product.name