# Generated by Django 2.1 on 2018-08-30 12:04

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('meals', '0007_auto_20180829_2244'),
    ]

    operations = [
        migrations.CreateModel(
            name='ListElement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(choices=[(1, 'prévu'), (2, 'acheté'), (3, 'supprimé')], default=1)),
                ('quantity', models.IntegerField(verbose_name='quantité')),
                ('provision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='meals.Provision')),
            ],
        ),
        migrations.CreateModel(
            name='Shopping',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(verbose_name='date des achats')),
                ('meals', models.ManyToManyField(to='meals.Meal')),
                ('provisions', models.ManyToManyField(through='meals.ListElement', to='meals.Provision')),
            ],
            options={
                'verbose_name': 'course',
            },
        ),
        migrations.CreateModel(
            name='Supplier',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='nom')),
                ('foods', models.ManyToManyField(to='meals.Food')),
            ],
            options={
                'verbose_name': 'fournisseur',
            },
        ),
        migrations.AddField(
            model_name='shopping',
            name='supplier',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='meals.Supplier'),
        ),
        migrations.AddField(
            model_name='listelement',
            name='shopping',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='meals.Shopping'),
        ),
    ]
