loads of work...
This commit is contained in:
@@ -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"),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user