models.py 1.31 KB
Newer Older
1 2 3
from django.db import models

class Restaurant(models.Model):
4 5
    name = models.CharField(max_length = 100)
    mainSchedule = models.ForeignKey('Schedule', related_name = 'restaurant_main')
Daniel Bond's avatar
Daniel Bond committed
6
    specialSchedules = models.ManyToManyField('Schedule', related_name = 'restaurant_special', null = True, blank = True)
7

8
class Schedule(models.Model):
Daniel Bond's avatar
Daniel Bond committed
9
    name = models.CharField(max_length = 100)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    dateValidStart = models.DateField(null = True, blank = True)
    dateValidEnd = models.DateField(null = True, blank = True)
    monOpen = models.TimeField(null = True, blank = True)
    monClose = models.TimeField(null = True, blank = True)
    tueOpen = models.TimeField(null = True, blank = True)
    tueClose = models.TimeField(null = True, blank = True)
    wedOpen = models.TimeField(null = True, blank = True)
    wedClose = models.TimeField(null = True, blank = True)
    thuOpen = models.TimeField(null = True, blank = True)
    thuClose = models.TimeField(null = True, blank = True)
    friOpen = models.TimeField(null = True, blank = True)
    friClose = models.TimeField(null = True, blank = True)
    satOpen = models.TimeField(null = True, blank = True)
    satClose = models.TimeField(null = True, blank = True)
    sunOpen = models.TimeField(null = True, blank = True)
    sunClose = models.TimeField(null = True, blank = True)