# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-09 11:58
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Entity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='A unique explanatory name. Will not be displayed on site.', max_length=50)),
                ('header', models.CharField(help_text='Will be displayed on site.', max_length=50)),
                ('help_text', models.TextField(blank=True, help_text='Will be displayed on site.', null=True)),
                ('description', models.TextField(blank=True, help_text='Internal. Will not be displayed on site.', null=True)),
                ('entity_type', models.IntegerField(choices=[(0, 'Single Value'), (1, 'List'), (2, 'Grid')], default=0, verbose_name='type')),
            ],
            options={
                'verbose_name_plural': 'entities',
            },
        ),
        migrations.CreateModel(
            name='EntityInSection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_new_row', models.BooleanField(default=True, help_text='If false, the viewer will force new line before this entity.')),
                ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ccenter.Entity')),
            ],
        ),
        migrations.CreateModel(
            name='EntityValueDefinition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(help_text='According to the Entity type, this will be the field label or the column header.', max_length=50)),
                ('order', models.PositiveSmallIntegerField(default=0, help_text='For grid.')),
                ('attribute', models.CharField(help_text='To identify the value by the consumers', max_length=50, null=True)),
                ('value_type', models.PositiveSmallIntegerField(choices=[('char_value', 'String'), ('integer_value', 'Integer'), ('boolean_value', 'Boolean')], default='char_value', max_length=50)),
                ('entity', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='ccenter.Entity')),
            ],
        ),
        migrations.CreateModel(
            name='ExtendedProperties',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('allow_add', models.BooleanField(default=True)),
                ('allow_delete', models.BooleanField(default=True)),
                ('entity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='ccenter.Entity')),
            ],
        ),
        migrations.CreateModel(
            name='Folder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='ccenter.Folder')),
            ],
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='A unique explanatory name. Will not be displayed on site.', max_length=50)),
                ('header', models.CharField(help_text='Will be displayed on site.', max_length=50)),
                ('help_text', models.TextField(blank=True, help_text='Will be displayed on site.', null=True)),
                ('description', models.TextField(blank=True, help_text='Internal. Will not be displayed on site.', null=True)),
                ('sub_title', models.CharField(blank=True, max_length=100, null=True)),
                ('folder', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ccenter.Folder')),
            ],
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='A unique explanatory name. Will not be displayed on site.', max_length=50)),
                ('header', models.CharField(help_text='Will be displayed on site.', max_length=50)),
                ('help_text', models.TextField(blank=True, help_text='Will be displayed on site.', null=True)),
                ('description', models.TextField(blank=True, help_text='Internal. Will not be displayed on site.', null=True)),
                ('entities', models.ManyToManyField(through='ccenter.EntityInSection', to='ccenter.Entity')),
                ('parent_section', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='ccenter.Section')),
            ],
        ),
        migrations.CreateModel(
            name='SectionInPage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveSmallIntegerField(default=0)),
                ('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ccenter.Page')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ccenter.Section')),
            ],
        ),
        migrations.CreateModel(
            name='Value',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_default', models.BooleanField(default=False)),
                ('order', models.PositiveSmallIntegerField(default=0, null=True)),
                ('value_type', models.CharField(choices=[('char_value', 'String'), ('integer_value', 'Integer'), ('boolean_value', 'Boolean')], default='char_value', max_length=50)),
                ('char_value', models.CharField(blank=True, max_length=200, null=True)),
                ('integer_value', models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(5)])),
                ('boolean_value', models.BooleanField()),
                ('value_field', models.CharField(blank=True, max_length=20, null=True)),
                ('value_definition', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ccenter.EntityValueDefinition')),
            ],
        ),
        migrations.AddField(
            model_name='page',
            name='sections',
            field=models.ManyToManyField(through='ccenter.SectionInPage', to='ccenter.Section'),
        ),
        migrations.AddField(
            model_name='extendedproperties',
            name='section',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='ccenter.Section'),
        ),
        migrations.AddField(
            model_name='entityinsection',
            name='section',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ccenter.Section'),
        ),
    ]
