Exemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Cuisine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cuisine_name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ingredient_name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Recipe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('recipe_name', models.CharField(max_length=100)),
                ('picture', models.ImageField(blank=True, upload_to=cookbook.models.picture_file_name)),
                ('cropping', image_cropping.fields.ImageRatioField('picture', '2000x2000', adapt_rotation=False, allow_fullsize=False, free_crop=False, help_text=None, hide_image_field=False, size_warning=True, verbose_name='cropping')),
                ('desc_summary', models.TextField(blank=True, default='', verbose_name='Description Summary')),
                ('text_ingred', models.TextField(blank=True, default='', verbose_name='Ingredients List')),
                ('instructions', models.TextField(blank=True, default='', verbose_name='Instructions')),
                ('notes', models.TextField(blank=True, default='', verbose_name='Notes and Tips')),
                ('personal_log', models.TextField(blank=True, default='', verbose_name='Personal Notes')),
                ('cooking_time', models.DurationField(default=datetime.timedelta(0))),
                ('total_time', models.DurationField(default=datetime.timedelta(0))),
                ('last_cook_time', models.DateField()),
                ('number_of_attempts', models.IntegerField(choices=[(0, '0'), (1, '1'), (2, '2'), (3, '3'), (4, '>3')], default=0)),
                ('is_experiment', models.BooleanField(default=False)),
                ('feature_position', models.IntegerField(default=0)),
                ('url_name', models.SlugField(unique=True)),
                ('categories', models.ManyToManyField(blank=True, to='cookbook.Category')),
                ('cuisines', models.ManyToManyField(blank=True, to='cookbook.Cuisine')),
                ('ingredients', models.ManyToManyField(blank=True, to='cookbook.Ingredient')),
            ],
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('cookbook', '0127_remove_invitelink_username'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserFile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('file', models.FileField(upload_to='files/')),
                ('file_size_kb', models.IntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('space',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cookbook.space')),
            ],
            bases=(models.Model, cookbook.models.PermissionModelMixin),
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('cookbook', '0151_auto_20210915_1037'),
    ]

    operations = [
        migrations.CreateModel(
            name='Automation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('type',
                 models.CharField(choices=[('FOOD_ALIAS', 'Food Alias'),
                                           ('UNIT_ALIAS', 'Unit Alias'),
                                           ('KEYWORD_ALIAS', 'Keyword Alias')],
                                  max_length=128)),
                ('name', models.CharField(default='', max_length=128)),
                ('description', models.TextField(blank=True, null=True)),
                ('param_1',
                 models.CharField(blank=True, max_length=128, null=True)),
                ('param_2',
                 models.CharField(blank=True, max_length=128, null=True)),
                ('param_3',
                 models.CharField(blank=True, max_length=128, null=True)),
                ('disabled', models.BooleanField(default=False)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('space',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cookbook.space')),
            ],
            bases=(models.Model, cookbook.models.PermissionModelMixin),
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('cookbook', '0114_importlog'),
    ]

    operations = [
        migrations.CreateModel(
            name='TelegramBot',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.CharField(max_length=256)),
                ('name', models.CharField(blank=True, default='', max_length=128)),
                ('chat_id', models.CharField(blank=True, default='', max_length=128)),
                ('webhook_token', models.UUIDField(default=uuid.uuid4)),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space')),
            ],
            bases=(models.Model, cookbook.models.PermissionModelMixin),
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('cookbook', '0113_auto_20210317_2017'),
    ]

    operations = [
        migrations.CreateModel(
            name='ImportLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(max_length=32)),
                ('running', models.BooleanField(default=True)),
                ('msg', models.TextField(default='')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('keyword', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='cookbook.keyword')),
                ('space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space')),
            ],
            bases=(models.Model, cookbook.models.PermissionModelMixin),
        ),
    ]