spradio-server-django/savepointradio/profiles/migrations/0002_create_dj_profile.py

23 lines
543 B
Python

# Generated by Django 2.0 on 2018-01-19 17:04
from django.db import migrations
def create_dj_profile(apps, schema_editor):
User = apps.get_model('core', 'RadioUser')
Profile = apps.get_model('profiles', 'RadioProfile')
db_alias = schema_editor.connection.alias
dj = User.objects.get(is_dj=True)
profile = Profile.objects.create(user=dj)
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.RunPython(create_dj_profile),
]