Added name to meal plan

This commit is contained in:
2020-02-23 14:23:26 +01:00
parent 78d5ffc8f3
commit 352c0c89f4
2 changed files with 23 additions and 0 deletions

View File

@ -221,6 +221,7 @@ class StoredIngredient(models.Model):
class MealPlan(models.Model):
author = models.ForeignKey(User, models.SET_NULL, null=True)
name = models.CharField(_('Name'), max_length=255)
monday_breakfast = models.ForeignKey(Recipe, models.SET_NULL, blank=True, null=True,
related_name='monday_breakfast')
@ -299,6 +300,9 @@ class MealPlan(models.Model):
sunday_dinner = models.ForeignKey(Recipe, models.SET_NULL, blank=True, null=True,
related_name='sunday_dinner')
def __str__(self):
return self.name
class Meta:
verbose_name = _('Meal plan')
verbose_name_plural = _('Meal plans')