# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-18 13:03
from __future__ import unicode_literals

from django.db import migrations

from django.contrib.auth import get_user_model


def link_authors(apps, schema_editor):
    Author = apps.get_model('blog', 'Author')
    User = get_user_model()
    counter = 0
    for author in Author.objects.all()[:3]:
        counter += 1
        author.name = User.objects.get(id=counter)
        author.save()


class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0010_auto_20170118_1657'),
    ]

    operations = [
        migrations.RunPython(link_authors)
    ]
