mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: create app orders and makemigrations
This commit is contained in:
18
gestaoRaul/orders/models.py
Normal file
18
gestaoRaul/orders/models.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from django.db import models
|
||||
|
||||
from products.models import Product
|
||||
from comandas.models import Comanda
|
||||
|
||||
|
||||
class Order(models.Model):
|
||||
id_product = models.ForeignKey(Product, on_delete=models.CASCADE)
|
||||
id_comanda = models.ForeignKey(Comanda, on_delete=models.CASCADE)
|
||||
obs = models.TextField(blank=True, null=True)
|
||||
queue = models.DateTimeField(auto_now_add=True)
|
||||
preparing = models.DateTimeField(null=True, blank=True)
|
||||
finished = models.DateTimeField(null=True, blank=True)
|
||||
delivered = models.DateTimeField(null=True, blank=True)
|
||||
canceled = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"Pedido {self.id} - Produto: {self.id_product} - Comanda: {self.id_comanda.name}"
|
||||
Reference in New Issue
Block a user