Files
watersurf-erp/app/references/migrations/0003_orderstatus_data.py

25 lines
570 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Data migration: начальные статусы заказов
from django.db import migrations
def create_default_statuses(apps, schema_editor):
OrderStatus = apps.get_model("references", "OrderStatus")
for name in ["В работе", "Выполнено"]:
OrderStatus.objects.get_or_create(name=name)
def noop(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
("references", "0002_order_status"),
]
operations = [
migrations.RunPython(create_default_statuses, noop),
]