This repository has been archived on 2019-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
2017-10-01 01:57:54 +02:00

35 lines
1014 B
Python

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils import timezone
from django.db import models
MAX_LENGTH = 60
# Create your models here.
class Menu(models.Model):
id = models.AutoField(primary_key=True)
date = models.DateField(default=timezone.now)
location = models.CharField(max_length=MAX_LENGTH)
menu = models.ManyToManyField("SingleFood")
class Meta:
unique_together = ('date', 'location')
class SingleFood(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(unique=True, max_length=MAX_LENGTH)
class HappyHour(models.Model):
id = models.AutoField(primary_key=True)
date = models.DateField(default=timezone.now)
starttime = models.DateField(default=timezone.now)
endtime = models.DateField(default=timezone.now)
location = models.CharField(max_length=MAX_LENGTH)
description = models.CharField(max_length=MAX_LENGTH)
class Meta:
unique_together = ('date', 'location')