mirror of https://gitlab.crans.org/bde/nk20
97 lines
5.5 KiB
Python
97 lines
5.5 KiB
Python
|
# Generated by Django 2.2.28 on 2024-05-17 18:44
|
||
|
|
||
|
from django.db import migrations, models
|
||
|
import django.db.models.deletion
|
||
|
import django.utils.timezone
|
||
|
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
initial = True
|
||
|
|
||
|
dependencies = [
|
||
|
('member', '0011_profile_vss_charter_read'),
|
||
|
]
|
||
|
|
||
|
operations = [
|
||
|
migrations.CreateModel(
|
||
|
name='Allergen',
|
||
|
fields=[
|
||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||
|
('gluten', models.BooleanField(default=False, verbose_name='gluten')),
|
||
|
('nut', models.BooleanField(default=False, verbose_name='nut')),
|
||
|
('crustecean', models.BooleanField(default=False, verbose_name='crustacean')),
|
||
|
('celery', models.BooleanField(default=False, verbose_name='celery')),
|
||
|
('egg', models.BooleanField(default=False, verbose_name='egg')),
|
||
|
('mustard', models.BooleanField(default=False, verbose_name='mustard')),
|
||
|
('fish', models.BooleanField(default=False, verbose_name='fish')),
|
||
|
('soy', models.BooleanField(default=False, verbose_name='soy')),
|
||
|
('milk', models.BooleanField(default=False, verbose_name='milk')),
|
||
|
('sulphite', models.BooleanField(default=False, verbose_name='sulphite')),
|
||
|
('lupine', models.BooleanField(default=False, verbose_name='lupine')),
|
||
|
('mollusc', models.BooleanField(default=False, verbose_name='mollusc')),
|
||
|
('groundnut', models.BooleanField(default=False, verbose_name='groundnut')),
|
||
|
('sesame', models.BooleanField(default=False, verbose_name='sesame')),
|
||
|
('alcohol', models.BooleanField(default=False, verbose_name='alcohol')),
|
||
|
],
|
||
|
options={
|
||
|
'verbose_name': 'Allergen',
|
||
|
'verbose_name_plural': 'Allergens',
|
||
|
},
|
||
|
),
|
||
|
migrations.CreateModel(
|
||
|
name='Basic_food',
|
||
|
fields=[
|
||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||
|
('name', models.CharField(max_length=255, verbose_name='name')),
|
||
|
('is_DLC', models.BooleanField(default=False, verbose_name='is DLC')),
|
||
|
('is_DDM', models.BooleanField(default=False, verbose_name='is DDM')),
|
||
|
('expiry_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, verbose_name='expiry date')),
|
||
|
('label', models.ImageField(default='pic/default.png', max_length=255, upload_to='label/', verbose_name='food label')),
|
||
|
('was_eaten', models.BooleanField(default=False, verbose_name='was eaten')),
|
||
|
('allergen', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='food.Allergen', verbose_name='allergen')),
|
||
|
('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='member.Club', verbose_name='owner')),
|
||
|
],
|
||
|
options={
|
||
|
'verbose_name': 'Basic food',
|
||
|
'verbose_name_plural': 'Basic foods',
|
||
|
},
|
||
|
),
|
||
|
migrations.CreateModel(
|
||
|
name='QR_code',
|
||
|
fields=[
|
||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||
|
('qr_code_number', models.PositiveIntegerField(verbose_name='QR-code number')),
|
||
|
],
|
||
|
options={
|
||
|
'verbose_name': 'QR-code',
|
||
|
'verbose_name_plural': 'QR-codes',
|
||
|
},
|
||
|
),
|
||
|
migrations.CreateModel(
|
||
|
name='Transformed_food',
|
||
|
fields=[
|
||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||
|
('name', models.CharField(max_length=255, verbose_name='name')),
|
||
|
('creation_date', models.DateTimeField(verbose_name='creation date')),
|
||
|
('expiry_date', models.DateTimeField(verbose_name='expiry date')),
|
||
|
('is_active', models.BooleanField(default=True, verbose_name='is active')),
|
||
|
('was_eaten', models.BooleanField(default=False, verbose_name='was eaten')),
|
||
|
('allergen', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='food.Allergen', verbose_name='allergen')),
|
||
|
('basic_ingredient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='food.Basic_food', verbose_name='basic ingredient')),
|
||
|
('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='member.Club', verbose_name='owner')),
|
||
|
('qr_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='food.QR_code', verbose_name='QR code')),
|
||
|
('transformed_ingredient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='food.Transformed_food', verbose_name='transformed ingredient')),
|
||
|
],
|
||
|
options={
|
||
|
'verbose_name': 'Transformed food',
|
||
|
'verbose_name_plural': 'Transformed foods',
|
||
|
},
|
||
|
),
|
||
|
migrations.AddField(
|
||
|
model_name='basic_food',
|
||
|
name='qr_code',
|
||
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='food.QR_code', verbose_name='QR code'),
|
||
|
),
|
||
|
]
|