# Generated by Django 3.1.2 on 2020-11-15 08:09

from django.db import migrations
from django.apps.registry import Apps


def update_sex_options(apps: Apps, schema_editor):
    Person = apps.get_model('index', 'Person')
    for i, obj in enumerate(Person.objects.all()):
        obj.sex = {
            'm': 'M',
            'f': 'F',
            '': 'X',
        }[obj.sex]
        obj.save()


class Migration(migrations.Migration):

    dependencies = [
        ('index', '0005_change_people_pk'),
    ]

    operations = [
        migrations.RunPython(update_sex_options)
    ]
