menu/models.py
from django.db import models
# Create your models here.
class Menu_Item(models.Model):
class MenuTypes(models.TextChoices):
APPETIZER = "Appetizer"
ENTREE = "Entree"
DESSERT = "Dessert"
WINE = "Wine"
BEER = "Beer"
COCKTAIL = "Cocktail"
name = models.CharField(max_length = 50)
description = models.CharField(max_length = 250)
price = models.DecimalField(max_digits = 4, decimal_places= 2)
item_type = models.CharField(max_length = 10, choices=MenuTypes.choices, default=MenuTypes.APPETIZER)
def __str__(self):
return self.name + ' - ' + self.item_type
class Menu_Drink_Item(models.Model):
class DrinkChoices(models.TextChoices):
WINE = "Wine"
BEER = "Beer"
COCKTAIL = "Cocktail"
name = models.CharField(max_length = 50)
description = models.CharField(max_length = 250)
price = models.DecimalField(max_digits = 4, decimal_places= 2)
drink_type = models.CharField(max_length = 10, choices=DrinkChoices.choices, default=DrinkChoices.COCKTAIL)
pairing_options = models.ForeignKey(Menu_Item, null=True, blank=True, on_delete = models.SET_NULL)
def __str__(self):
return self.name
custOrders/models.py
from django.db import models
from menu.models import Menu_Item
# Create your models here.
class tableTable(models.Model):
tableTypeChoices = [
('bar', 'bar'),
('booth', 'booth'),
('table', 'table'),
('hi-top', 'hi-top'),
('patio', 'patio'),
]
statusChoices = [
('cleaned', 'cleaned'),
('seated', 'seated'),
('closed', 'closed'),
('reserved', 'reserved'),
]
#primary key field
seats = models.IntegerField(blank=False, null=False)
tableType = models.CharField(max_length=255, blank=False, null=False, choices=tableTypeChoices)
status = models.CharField(max_length=255, blank=False, null=False, choices=statusChoices)
server = models.CharField(max_length=255, blank=False, null=False)
def __str__(self):
return '%s %s' % (self.id, self.tableType)
class Menu_Item(models.Model):
class MenuTypes(models.TextChoices):
APPETIZER = "Appetizer"
ENTREE = "Entree"
DESSERT = "Dessert"
WINE = "Wine"
BEER = "Beer"
COCKTAIL = "Cocktail"
name = models.CharField(max_length = 50)
description = models.CharField(max_length = 250)
price = models.DecimalField(max_digits = 4, decimal_places= 2)
item_type = models.CharField(max_length = 10, choices=MenuTypes.choices, default=MenuTypes.APPETIZER)
def __str__(self):
return self.name + ' - ' + self.item_type
Any ideas?
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ebd76d62-ca29-40df-94e9-1e1dcd831916n%40googlegroups.com.
No comments:
Post a Comment