Restoroo/core/models/businesses.py

26 lines
757 B
Python
Raw Normal View History

2022-08-04 15:58:57 +00:00
from django.db import models
from .media import Image
from .geo import Location
class Chain(models.Model):
'''
Model for "Restaurant Chains"
Each Restaurant belongs to a Chain just in case any large corporation
running several different chains comes around...
'''
name = models.CharField(max_length=128)
logo = models.ForeignKey(Image, models.PROTECT, null=True)
class Restaurant(models.Model):
'''
Model representing an individual Restaurant within a Chain
'''
name = models.CharField(max_length=128)
logo = models.ForeignKey(Image, models.PROTECT, null=True)
location = models.ForeignKey(Location, models.PROTECT)
maximum_capacity = models.PositiveSmallIntegerField(null=True, blank=True)