create comanda | detalhe comanda

This commit is contained in:
2024-12-12 21:33:04 -03:00
parent 2f84ca97c3
commit a3bb7bb674
15 changed files with 284 additions and 21 deletions

View File

@@ -14,10 +14,14 @@ 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)
def __str__(self) -> str:
return self.name
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)
applicant = models.CharField(max_length=255, null=True, blank=True)
applicant = models.CharField(max_length=255, null=True, blank=True)
def __str__(self) -> str:
return self.comanda.name + " - " + self.product.name