# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-16 17:57
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Asset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Название')),
                ('content', models.TextField(verbose_name='Контент')),
                ('order', models.PositiveIntegerField(db_index=True, default=0)),
                ('published', models.BooleanField(db_index=True, default=False, verbose_name='Опубликован')),
            ],
            options={
                'verbose_name': 'Код',
                'verbose_name_plural': 'Коды',
                'ordering': ('order',),
            },
        ),
        migrations.CreateModel(
            name='AssetGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Название')),
                ('key', models.CharField(db_index=True, max_length=20, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z', 32), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')], verbose_name='Ключ')),
            ],
            options={
                'verbose_name': 'Група кодов',
                'verbose_name_plural': 'Группы кодов',
            },
        ),
        migrations.AddField(
            model_name='asset',
            name='group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user_assets.AssetGroup', verbose_name='Группа кодов'),
        ),
    ]
