mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-26 18:37:12 +00:00
85 lines
4.0 KiB
Python
85 lines
4.0 KiB
Python
# Generated by Django 2.2.28 on 2024-07-05 08:57
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('contenttypes', '0002_remove_content_type_name'),
|
|
('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')),
|
|
('name', models.CharField(max_length=255, verbose_name='name')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Allergen',
|
|
'verbose_name_plural': 'Allergens',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='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')),
|
|
('expiry_date', models.DateTimeField(verbose_name='expiry date')),
|
|
('was_eaten', models.BooleanField(default=False, verbose_name='was eaten')),
|
|
('is_ready', models.BooleanField(default=False, verbose_name='is ready')),
|
|
('allergens', models.ManyToManyField(blank=True, to='food.Allergen', verbose_name='allergen')),
|
|
('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='member.Club', verbose_name='owner')),
|
|
('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_food.food_set+', to='contenttypes.ContentType')),
|
|
],
|
|
options={
|
|
'verbose_name': 'foods',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='BasicFood',
|
|
fields=[
|
|
('food_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='food.Food')),
|
|
('date_type', models.CharField(choices=[('DLC', 'DLC'), ('DDM', 'DDM')], max_length=255)),
|
|
('arrival_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='arrival date')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Basic food',
|
|
'verbose_name_plural': 'Basic foods',
|
|
},
|
|
bases=('food.food',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='QRCode',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('qr_code_number', models.PositiveIntegerField(unique=True, verbose_name='QR-code number')),
|
|
('food_container', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='QR_code', to='food.Food', verbose_name='food container')),
|
|
],
|
|
options={
|
|
'verbose_name': 'QR-code',
|
|
'verbose_name_plural': 'QR-codes',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='TransformedFood',
|
|
fields=[
|
|
('food_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='food.Food')),
|
|
('creation_date', models.DateTimeField(verbose_name='creation date')),
|
|
('is_active', models.BooleanField(default=True, verbose_name='is active')),
|
|
('ingredient', models.ManyToManyField(blank=True, related_name='transformed_ingredient_inv', to='food.Food', verbose_name='transformed ingredient')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Transformed food',
|
|
'verbose_name_plural': 'Transformed foods',
|
|
},
|
|
bases=('food.food',),
|
|
),
|
|
]
|