26 lines
757 B
Python
26 lines
757 B
Python
|
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)
|