2017-02-14 21:23:45 +03:00
|
|
|
# Generated by Django 1.9 on 2015-12-04 18:20
|
|
|
|
|
|
|
|
import django.db.models.deletion
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
2022-10-19 17:10:30 +03:00
|
|
|
("ingredients", "0001_initial"),
|
2017-02-14 21:23:45 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2022-10-19 17:10:30 +03:00
|
|
|
name="Recipe",
|
2017-02-14 21:23:45 +03:00
|
|
|
fields=[
|
2022-10-19 17:10:30 +03:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("title", models.CharField(max_length=100)),
|
|
|
|
("instructions", models.TextField()),
|
2017-02-14 21:23:45 +03:00
|
|
|
],
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2022-10-19 17:10:30 +03:00
|
|
|
name="RecipeIngredient",
|
2017-02-14 21:23:45 +03:00
|
|
|
fields=[
|
2022-10-19 17:10:30 +03:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.AutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("amount", models.FloatField()),
|
|
|
|
(
|
|
|
|
"unit",
|
|
|
|
models.CharField(
|
|
|
|
choices=[("kg", "Kilograms"), ("l", "Litres"), ("", "Units")],
|
|
|
|
max_length=20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"ingredient",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
related_name="used_by",
|
|
|
|
to="ingredients.Ingredient",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"recipes",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
related_name="amounts",
|
|
|
|
to="recipes.Recipe",
|
|
|
|
),
|
|
|
|
),
|
2017-02-14 21:23:45 +03:00
|
|
|
],
|
|
|
|
),
|
|
|
|
]
|