# Generated by Django 3.1.5 on 2021-05-13 01:09

import app1.models
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Filter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=25, unique=True, verbose_name='نام')),
                ('slug', models.SlugField(allow_unicode=True, db_index=False, verbose_name='آدرس وب')),
            ],
            options={
                'verbose_name': 'فيلتر',
                'verbose_name_plural': 'فيلتر ها',
            },
        ),
        migrations.CreateModel(
            name='Image_icone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=app1.models.path_selector, verbose_name='تصوير')),
                ('alt', models.CharField(blank=True, default='', max_length=55, verbose_name='توضيحات عکس')),
                ('path', models.CharField(default='products', max_length=20, verbose_name='آدرس')),
            ],
            options={
                'verbose_name': 'تصوير آيکن',
                'verbose_name_plural': 'تصاوير آيکن ها',
            },
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('submiters', models.PositiveIntegerField(default=0, verbose_name='وارد کنندگان')),
                ('rate', models.DecimalField(decimal_places=1, default=0, max_digits=2, verbose_name='رتبه')),
            ],
            options={
                'verbose_name': 'رتبه بندي',
                'verbose_name_plural': 'رتبه بندي ها',
            },
        ),
        migrations.CreateModel(
            name='Test3',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('field_1', models.CharField(error_messages={'null': 'null loool', 'unique': 'looooool'}, max_length=60, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Test4',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('available', models.BooleanField(error_messages={'invalid': 'looooool', 'null': 'null loool'})),
            ],
        ),
        migrations.CreateModel(
            name='Test5',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('field_1', models.GenericIPAddressField()),
                ('field_2', models.CharField(blank=True, max_length=60)),
            ],
        ),
        migrations.CreateModel(
            name='Test6',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('field_1', models.CharField(max_length=60, unique_for_date='created', verbose_name='فيلد 1')),
                ('created', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Root',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=25, unique=True, verbose_name='نام')),
                ('slug', models.SlugField(allow_unicode=True, db_index=False, verbose_name='آدرس وب')),
                ('level', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(3)], verbose_name='سطح')),
                ('post_product', models.CharField(default='product', max_length=10, verbose_name='کالا يا پست')),
                ('father_root', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.root', verbose_name='ريشه پدر')),
            ],
            options={
                'verbose_name': 'ريشه',
                'verbose_name_plural': 'ريشه ها',
                'ordering': ('level', '-father_root_id'),
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=25, verbose_name='نام')),
                ('slug', models.SlugField(allow_unicode=True, db_index=False, verbose_name='آدرس وب')),
                ('filter_filter_attribute', models.CharField(max_length=10, verbose_name='فيلتر و آيتم')),
                ('meta_title', models.CharField(blank=True, default='', max_length=60, verbose_name='متا عنوان')),
                ('meta_description', models.TextField(blank=True, default='', validators=[django.core.validators.MaxLengthValidator(160)], verbose_name='متا توضيحات')),
                ('brief_description', models.TextField(validators=[django.core.validators.MaxLengthValidator(500)], verbose_name='توضيحات مختصر')),
                ('price', models.DecimalField(decimal_places=0, default=-1, max_digits=10, verbose_name='قيمت')),
                ('available', models.BooleanField(db_index=True, default=False, verbose_name='موجودي')),
                ('visible', models.BooleanField(default=True, verbose_name='حذف')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='ساخته شده')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='تغيير يافته')),
                ('image_icon', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to='app1.image_icone', verbose_name='تصوير آيکن')),
                ('rating', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to='app1.rating', verbose_name='رتبه بندي')),
                ('root', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='app1.root', verbose_name='ريشه')),
            ],
            options={
                'verbose_name': 'کالا',
                'verbose_name_plural': 'کالا ها',
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=60, verbose_name='عنوان')),
                ('slug', models.SlugField(allow_unicode=True, db_index=False, verbose_name='آدرس وب')),
                ('meta_title', models.CharField(blank=True, default='', max_length=60, verbose_name='متا عنوان')),
                ('meta_description', models.TextField(blank=True, default='', validators=[django.core.validators.MaxLengthValidator(160)], verbose_name='متا توضيحات')),
                ('brief_description', models.TextField(validators=[django.core.validators.MaxLengthValidator(150)], verbose_name='توضيحات مختصر')),
                ('visible', models.BooleanField(default=True, verbose_name='حذف')),
                ('published_date', models.DateTimeField(auto_now_add=True, verbose_name='تاريخ انتشار')),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='نويسنده')),
                ('image_icon', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to='app1.image_icone', verbose_name='تصوير آيکن')),
                ('root', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='app1.root', verbose_name='ريشه')),
            ],
            options={
                'verbose_name': 'پست',
                'verbose_name_plural': 'پست ها',
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='products_images/%Y/%m/%d', verbose_name='تصوير')),
                ('alt', models.CharField(blank=True, default='', max_length=55, verbose_name='توضيحات عکس')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.product', verbose_name='کالا')),
            ],
            options={
                'verbose_name': 'تصوير',
                'verbose_name_plural': 'تصاوير',
            },
        ),
        migrations.CreateModel(
            name='Filter_Attribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=25, verbose_name='نام')),
                ('filterr', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filter_attributes', to='app1.filter', verbose_name='فيلتر')),
            ],
            options={
                'verbose_name': 'آيتم فيلتر',
                'verbose_name_plural': 'آيتم هاي فيلتر',
            },
        ),
        migrations.AddField(
            model_name='filter',
            name='roots',
            field=models.ManyToManyField(to='app1.Root', verbose_name='ريشه ها'),
        ),
        migrations.CreateModel(
            name='Content',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(verbose_name='متن')),
                ('image', models.ImageField(blank=True, upload_to='posts_images/%Y/%m/%d', verbose_name='تصوير')),
                ('video', models.FileField(blank=True, upload_to='posts_videos/%Y/%m/%d', verbose_name='ويديو')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.post', verbose_name='پست')),
            ],
            options={
                'verbose_name': 'محتوا',
                'verbose_name_plural': 'محتوا',
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('confirm_status', models.CharField(max_length=1, verbose_name='وضعيت تاييد')),
                ('published_date', models.DateTimeField(auto_now_add=True, verbose_name='تاريخ انتشار')),
                ('content', models.TextField(validators=[django.core.validators.MaxLengthValidator(500)], verbose_name='محتوي')),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='comment_set_author', related_query_name='comments_author', to=settings.AUTH_USER_MODEL, verbose_name='نويسنده')),
                ('confermer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='comment_set_confermer', related_query_name='comments_confermer', to=settings.AUTH_USER_MODEL, verbose_name='تاييد کننده')),
                ('post', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.post', verbose_name='پست')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app1.product', verbose_name='کالا')),
            ],
            options={
                'verbose_name': 'نظر',
                'verbose_name_plural': 'نظرات',
            },
        ),
    ]
