# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models


class Migration(DataMigration):
    def forwards(self, orm):
        "Write your forwards methods here."
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        for book in orm["catalog.book"].objects.all():
            for author in book.new_authors.all():
                book.authors.add(author)
                book.save()

    def backwards(self, orm):
        "Write your backwards methods here."

    models = {
        "auth.group": {
            "Meta": {"object_name": "Group"},
            "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
            "name": (
                "django.db.models.fields.CharField",
                [],
                {"unique": "True", "max_length": "80"},
            ),
            "permissions": (
                "django.db.models.fields.related.ManyToManyField",
                [],
                {
                    "to": "orm['auth.Permission']",
                    "symmetrical": "False",
                    "blank": "True",
                },
            ),
        },
        "auth.permission": {
            "Meta": {
                "ordering": "('content_type__app_label', 'content_type__model', 'codename')",
                "unique_together": "(('content_type', 'codename'),)",
                "object_name": "Permission",
            },
            "codename": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "100"},
            ),
            "content_type": (
                "django.db.models.fields.related.ForeignKey",
                [],
                {"to": "orm['contenttypes.ContentType']"},
            ),
            "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
            "name": ("django.db.models.fields.CharField", [], {"max_length": "50"}),
        },
        "auth.user": {
            "Meta": {"object_name": "User"},
            "date_joined": (
                "django.db.models.fields.DateTimeField",
                [],
                {"default": "datetime.datetime.now"},
            ),
            "email": (
                "django.db.models.fields.EmailField",
                [],
                {"max_length": "75", "blank": "True"},
            ),
            "first_name": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "30", "blank": "True"},
            ),
            "groups": (
                "django.db.models.fields.related.ManyToManyField",
                [],
                {"to": "orm['auth.Group']", "symmetrical": "False", "blank": "True"},
            ),
            "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
            "is_active": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "True"},
            ),
            "is_staff": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "False"},
            ),
            "is_superuser": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "False"},
            ),
            "last_login": (
                "django.db.models.fields.DateTimeField",
                [],
                {"default": "datetime.datetime.now"},
            ),
            "last_name": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "30", "blank": "True"},
            ),
            "password": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "128"},
            ),
            "user_permissions": (
                "django.db.models.fields.related.ManyToManyField",
                [],
                {
                    "to": "orm['auth.Permission']",
                    "symmetrical": "False",
                    "blank": "True",
                },
            ),
            "username": (
                "django.db.models.fields.CharField",
                [],
                {"unique": "True", "max_length": "30"},
            ),
        },
        "catalog.book": {
            "Meta": {"object_name": "Book", "_ormbases": ["catalog.Item"]},
            "authors": (
                "django.db.models.fields.related.ManyToManyField",
                [],
                {
                    "symmetrical": "False",
                    "to": "orm['catalog.Person']",
                    "null": "True",
                    "blank": "True",
                },
            ),
            "dimensions": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "20", "null": "True", "blank": "True"},
            ),
            "edition": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "50", "null": "True", "blank": "True"},
            ),
            "editors": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200", "null": "True", "blank": "True"},
            ),
            "features": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "100", "null": "True", "blank": "True"},
            ),
            "genre": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "100", "null": "True", "blank": "True"},
            ),
            "illustrator": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200", "null": "True", "blank": "True"},
            ),
            "isbn": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "20", "null": "True", "blank": "True"},
            ),
            "item_ptr": (
                "django.db.models.fields.related.OneToOneField",
                [],
                {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
            ),
            "library_of_congress_number": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "20", "null": "True", "blank": "True"},
            ),
            "new_authors": (
                "django.db.models.fields.related.ManyToManyField",
                [],
                {
                    "blank": "True",
                    "related_name": "'old_authors'",
                    "null": "True",
                    "symmetrical": "False",
                    "to": "orm['catalog.Person']",
                },
            ),
            "pages": (
                "django.db.models.fields.IntegerField",
                [],
                {"null": "True", "blank": "True"},
            ),
            "printer": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200", "null": "True", "blank": "True"},
            ),
            "publish_date": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "20", "null": "True", "blank": "True"},
            ),
            "publisher": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200", "null": "True", "blank": "True"},
            ),
            "subtitle": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "100", "null": "True", "blank": "True"},
            ),
        },
        "catalog.item": {
            "Meta": {"object_name": "Item"},
            "created": (
                "django.db.models.fields.DateTimeField",
                [],
                {"auto_now_add": "True", "blank": "True"},
            ),
            "created_by": (
                "django.db.models.fields.related.ForeignKey",
                [],
                {"related_name": "'+'", "to": "orm['auth.User']"},
            ),
            "deleted": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "False"},
            ),
            "featured": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "False"},
            ),
            "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
            "image": (
                "sorl.thumbnail.fields.ImageField",
                [],
                {"max_length": "100", "null": "True", "blank": "True"},
            ),
            "is_active": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "True"},
            ),
            "last_updated": (
                "django.db.models.fields.DateTimeField",
                [],
                {"auto_now": "True", "auto_now_add": "True", "blank": "True"},
            ),
            "last_updated_by": (
                "django.db.models.fields.related.ForeignKey",
                [],
                {"related_name": "'+'", "to": "orm['auth.User']"},
            ),
            "long_description": (
                "django.db.models.fields.TextField",
                [],
                {"null": "True", "blank": "True"},
            ),
            "price": (
                "django.db.models.fields.DecimalField",
                [],
                {"max_digits": "7", "decimal_places": "2"},
            ),
            "shipping_cost": (
                "django.db.models.fields.DecimalField",
                [],
                {"max_digits": "7", "decimal_places": "2"},
            ),
            "shipping_cost_multiple": (
                "django.db.models.fields.DecimalField",
                [],
                {"max_digits": "7", "decimal_places": "2"},
            ),
            "sku": (
                "django.db.models.fields.SlugField",
                [],
                {"unique": "True", "max_length": "20"},
            ),
            "subclass_type": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200"},
            ),
            "synopsis": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200", "null": "True", "blank": "True"},
            ),
            "tax_free": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "False"},
            ),
            "title": ("django.db.models.fields.CharField", [], {"max_length": "50"}),
        },
        "catalog.map": {
            "Meta": {"object_name": "Map", "_ormbases": ["catalog.Item"]},
            "dimensions": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "20", "null": "True", "blank": "True"},
            ),
            "item_ptr": (
                "django.db.models.fields.related.OneToOneField",
                [],
                {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
            ),
        },
        "catalog.movie": {
            "Meta": {"object_name": "Movie", "_ormbases": ["catalog.Item"]},
            "captioning": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "50", "null": "True", "blank": "True"},
            ),
            "format": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "20", "null": "True", "blank": "True"},
            ),
            "genre": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "100", "null": "True", "blank": "True"},
            ),
            "item_ptr": (
                "django.db.models.fields.related.OneToOneField",
                [],
                {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
            ),
            "language": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "50", "null": "True", "blank": "True"},
            ),
            "music": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200", "null": "True", "blank": "True"},
            ),
            "producer": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "200", "null": "True", "blank": "True"},
            ),
            "region": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "50", "null": "True", "blank": "True"},
            ),
            "runtime_minutes": (
                "django.db.models.fields.IntegerField",
                [],
                {"null": "True", "blank": "True"},
            ),
            "sound": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "50", "null": "True", "blank": "True"},
            ),
        },
        "catalog.person": {
            "Meta": {"object_name": "Person"},
            "created": (
                "django.db.models.fields.DateTimeField",
                [],
                {"auto_now_add": "True", "blank": "True"},
            ),
            "created_by": (
                "django.db.models.fields.related.ForeignKey",
                [],
                {"related_name": "'+'", "to": "orm['auth.User']"},
            ),
            "deleted": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "False"},
            ),
            "description": (
                "django.db.models.fields.TextField",
                [],
                {"default": "''", "null": "True", "blank": "True"},
            ),
            "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
            "image": (
                "sorl.thumbnail.fields.ImageField",
                [],
                {"max_length": "100", "null": "True", "blank": "True"},
            ),
            "is_active": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "True"},
            ),
            "last_updated": (
                "django.db.models.fields.DateTimeField",
                [],
                {"auto_now": "True", "auto_now_add": "True", "blank": "True"},
            ),
            "last_updated_by": (
                "django.db.models.fields.related.ForeignKey",
                [],
                {"related_name": "'+'", "to": "orm['auth.User']"},
            ),
            "name": ("django.db.models.fields.CharField", [], {"max_length": "60"}),
            "slug": (
                "django.db.models.fields.SlugField",
                [],
                {"unique": "True", "max_length": "60"},
            ),
            "title": (
                "django.db.models.fields.CharField",
                [],
                {"default": "''", "max_length": "60", "null": "True", "blank": "True"},
            ),
        },
        "catalog.subscription": {
            "Meta": {"object_name": "Subscription", "_ormbases": ["catalog.Item"]},
            "duration": ("django.db.models.fields.IntegerField", [], {}),
            "item_ptr": (
                "django.db.models.fields.related.OneToOneField",
                [],
                {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
            ),
            "shipping_method": (
                "django.db.models.fields.CharField",
                [],
                {"default": "u'REGULAR'", "max_length": "20"},
            ),
            "shipping_type": (
                "django.db.models.fields.CharField",
                [],
                {"default": "'INSTATE'", "max_length": "10"},
            ),
        },
        "catalog.zipcode": {
            "Meta": {"object_name": "ZipCode"},
            "city": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "64", "null": "True", "blank": "True"},
            ),
            "county": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "64", "null": "True", "blank": "True"},
            ),
            "created": (
                "django.db.models.fields.DateTimeField",
                [],
                {"auto_now_add": "True", "blank": "True"},
            ),
            "created_by": (
                "django.db.models.fields.related.ForeignKey",
                [],
                {"related_name": "'+'", "to": "orm['auth.User']"},
            ),
            "deleted": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "False"},
            ),
            "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
            "is_active": (
                "django.db.models.fields.BooleanField",
                [],
                {"default": "True"},
            ),
            "last_updated": (
                "django.db.models.fields.DateTimeField",
                [],
                {"auto_now": "True", "auto_now_add": "True", "blank": "True"},
            ),
            "last_updated_by": (
                "django.db.models.fields.related.ForeignKey",
                [],
                {"related_name": "'+'", "to": "orm['auth.User']"},
            ),
            "state": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "2", "null": "True", "blank": "True"},
            ),
            "zipcode": (
                "django.db.models.fields.CharField",
                [],
                {"unique": "True", "max_length": "9"},
            ),
        },
        "contenttypes.contenttype": {
            "Meta": {
                "ordering": "('name',)",
                "unique_together": "(('app_label', 'model'),)",
                "object_name": "ContentType",
                "db_table": "'django_content_type'",
            },
            "app_label": (
                "django.db.models.fields.CharField",
                [],
                {"max_length": "100"},
            ),
            "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
            "model": ("django.db.models.fields.CharField", [], {"max_length": "100"}),
            "name": ("django.db.models.fields.CharField", [], {"max_length": "100"}),
        },
    }

    complete_apps = ["catalog"]
    symmetrical = True
