# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-20 22:21
from __future__ import unicode_literals

import arcgis_marketplace.fields
import core_flavor.models
from django.conf import settings
import django.contrib.postgres.fields.jsonb
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
import django.utils.timezone
import model_utils.fields
import taggit.managers
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('taggit', '0002_auto_20150616_2121'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('removed', models.DateTimeField(blank=True, null=True, verbose_name='removed')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('expired', models.DateTimeField(null=True)),
                ('data', django.contrib.postgres.fields.jsonb.JSONField()),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='user')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GenericUUIDTaggedItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.UUIDField(editable=False)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arcgis_marketplace_genericuuidtaggeditem_tagged_items', to='contenttypes.ContentType', verbose_name='Content type')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arcgis_marketplace_genericuuidtaggeditem_items', to='taggit.Tag')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('removed', models.DateTimeField(blank=True, null=True, verbose_name='removed')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=255, verbose_name='title')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('price', models.FloatField(validators=[django.core.validators.MinValueValidator(0)], verbose_name='price')),
            ],
            options={
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='WebMapingApp',
            fields=[
                ('item_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='arcgis_marketplace.Item')),
                ('purpose', models.CharField(choices=[('ready_to_use', 'Ready to use'), ('configurable', 'Configurable'), ('self_configurable', 'Self configurable'), ('code_sample', 'Code sample')], max_length=32, verbose_name='purpose')),
                ('api', models.CharField(choices=[('javascript', 'Javascript'), ('flex', 'Flex'), ('silverlight', 'Silverlight'), ('web_adf', 'Web ADF'), ('other', 'Other')], max_length=32, verbose_name='api')),
                ('file', arcgis_marketplace.fields.CompressField(upload_to=core_flavor.models.UUIDUploadTo('arcgis/items/%Y/%m/'))),
            ],
            options={
                'abstract': False,
            },
            bases=('arcgis_marketplace.item',),
            managers=[
                ('objects', django.db.models.manager.Manager()),
                ('base_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name='item',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='arcgis_marketplace.Account', verbose_name='owner'),
        ),
        migrations.AddField(
            model_name='item',
            name='polymorphic_ctype',
            field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_arcgis_marketplace.item_set+', to='contenttypes.ContentType'),
        ),
        migrations.AddField(
            model_name='item',
            name='tags',
            field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='arcgis_marketplace.GenericUUIDTaggedItem', to='taggit.Tag', verbose_name='Tags'),
        ),
    ]
