# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 21:36
from __future__ import unicode_literals

from django.db import migrations

INITIAL_FORMATS = [
    ('Book', 'http://schema.org/Book'),
    ('Periodical', 'http://schema.org/Periodical'),
    ('Article', 'http://schema.org/Article')
]

def initial_item_formats(apps, schema_editor):
    Format = apps.get_model("books", "Format")

    for name, uri in INITIAL_FORMATS:
        Format.objects.get_or_create(name=name, uri=uri)


class Migration(migrations.Migration):

    dependencies = [
        ('books', '0009_item_format'),
    ]

    operations = [
        migrations.RunPython(initial_item_formats,
                             migrations.RunPython.noop)

    ]
