You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
639 B
21 lines
639 B
# Generated by Django 2.0.7 on 2019-06-07 20:48
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def add_childs(apps, schema_editor):
|
|
User = apps.get_model('user', 'User')
|
|
Child = apps.get_model('user', 'Child')
|
|
for user in User.objects.exclude(child_first_name=''):
|
|
Child.objects.get_or_create(user=user, first_name=user.child_first_name, last_name=user.child_last_name,
|
|
gender=user.child_gender, birthday=user.child_birthday)
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('user', '0032_child'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(add_childs),
|
|
]
|
|
|