# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-30 16:28
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django_smalluuid.models
import everyvoter_common.utils.models
import rendering.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('branding', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Block',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('uuid', django_smalluuid.models.SmallUUIDField(db_index=True, default=django_smalluuid.models.UUIDDefault(), editable=False, unique=True)),
                ('name', models.CharField(max_length=50, verbose_name=b'Block Name')),
                ('code', models.TextField(validators=[rendering.validators.validate_template], verbose_name=b'HTML Code')),
                ('weight', models.IntegerField(default=50, verbose_name=b'Weight')),
            ],
            options={
                'verbose_name': 'Block',
                'verbose_name_plural': 'Blocks',
            },
            bases=(everyvoter_common.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.CreateModel(
            name='BlockCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('uuid', django_smalluuid.models.SmallUUIDField(db_index=True, default=django_smalluuid.models.UUIDDefault(), editable=False, unique=True)),
                ('name', models.CharField(max_length=50, verbose_name=b'Blog Category Name')),
                ('organization', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='branding.Organization')),
            ],
            options={
                'verbose_name': 'Block Category',
                'verbose_name_plural': 'Block Categories',
            },
            bases=(everyvoter_common.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.CreateModel(
            name='EmailBlocks',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'abstract': False,
            },
            bases=(everyvoter_common.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.AddField(
            model_name='block',
            name='categories',
            field=models.ManyToManyField(blank=True, to='blocks.BlockCategory'),
        ),
        migrations.AddField(
            model_name='block',
            name='organization',
            field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='branding.Organization'),
        ),
    ]
