# Generated by Django 4.0.3 on 2022-03-21 10:54
import random

from django.db import migrations


class Migration(migrations.Migration):
    def set_menutype_for_dishes(apps, schema_editor):
        menu_types = [
            "classic",
            "low_calorie",
            "vegan",
            "keto",
        ]

        Dishes = apps.get_model("foodplanapp", "Dish")
        dishes_set = Dishes.objects.all()
        for dish in dishes_set.iterator():
            dish.menu_type = random.choice(menu_types)
            dish.save()

    dependencies = [
        (
            "foodplanapp",
            "0019_remove_order_allergy1_remove_order_allergy2_and_more",
        ),
    ]

    operations = [migrations.RunPython(set_menutype_for_dishes)]
