loads of work...

This commit is contained in:
2019-04-28 15:41:00 +02:00
parent 87d683d4af
commit d31b2dd348
21 changed files with 447 additions and 318 deletions

View File

@@ -1,12 +1,20 @@
from django.db import models
from recipe_book.models import Recipe
# Create your models here.
class WeekPlanning(models.Model):
pass
class DayMeals(models.Model):
midi = models.ForeignKey(
Recipe,
on_delete=models.CASCADE )
from django.db import models
from recipe_book.models import Recipe
# Create your models here.
class Meal(models.Model):
day = models.DateField()
kind = models.SmallIntegerField(choices=(
(0, 'Petit-déjeuner'),
(1, 'Déjeuner'),
(2, 'Goûter'),
(3, 'Diner'),
))
dishes = models.ManyToManyField(
'recipe_book.Recipe',
)
class Meta:
constraints = [
models.UniqueConstraint(fields=['day', 'kind'], name="unique_constraint"),
]