generated from 2martens/django-template
Renamed UsedIngredients to UsedIngredient
This commit is contained in:
@ -66,7 +66,7 @@ class Migration(migrations.Migration):
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='UsedIngredients',
|
name='UsedIngredient',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('amount', models.PositiveIntegerField(help_text='Please specify the used amount of the ingredient', verbose_name='Amount')),
|
('amount', models.PositiveIntegerField(help_text='Please specify the used amount of the ingredient', verbose_name='Amount')),
|
||||||
@ -88,7 +88,7 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='recipe',
|
model_name='recipe',
|
||||||
name='ingredients',
|
name='ingredients',
|
||||||
field=models.ManyToManyField(through='food_planner.UsedIngredients', to='food_planner.Ingredient'),
|
field=models.ManyToManyField(through='food_planner.UsedIngredient', to='food_planner.Ingredient'),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='recipe',
|
model_name='recipe',
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class Recipe(models.Model):
|
|||||||
author = models.ForeignKey(User, models.SET_NULL, null=True)
|
author = models.ForeignKey(User, models.SET_NULL, null=True)
|
||||||
kitchen_utilities = models.ManyToManyField(KitchenUtility,
|
kitchen_utilities = models.ManyToManyField(KitchenUtility,
|
||||||
through='UsedKitchenUtilities')
|
through='UsedKitchenUtilities')
|
||||||
ingredients = models.ManyToManyField(Ingredient, through='UsedIngredients')
|
ingredients = models.ManyToManyField(Ingredient, through='UsedIngredient')
|
||||||
|
|
||||||
name = models.CharField(_('Name'), max_length=255)
|
name = models.CharField(_('Name'), max_length=255)
|
||||||
image = models.ImageField(_('Image'), blank=True, null=True)
|
image = models.ImageField(_('Image'), blank=True, null=True)
|
||||||
@ -104,7 +104,7 @@ class UsedKitchenUtilities(models.Model):
|
|||||||
default=1)
|
default=1)
|
||||||
|
|
||||||
|
|
||||||
class UsedIngredients(models.Model):
|
class UsedIngredient(models.Model):
|
||||||
recipe = models.ForeignKey(Recipe, models.CASCADE)
|
recipe = models.ForeignKey(Recipe, models.CASCADE)
|
||||||
ingredient = models.ForeignKey(Ingredient, models.CASCADE)
|
ingredient = models.ForeignKey(Ingredient, models.CASCADE)
|
||||||
amount = models.PositiveIntegerField(_('Amount'),
|
amount = models.PositiveIntegerField(_('Amount'),
|
||||||
|
|||||||
Reference in New Issue
Block a user