# Generated by Django 2.2.2 on 2020-12-05 16:26

from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='AdvUser',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата регистрации')),
                ('updated', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата обновления данных')),
                ('count', models.FloatField(default=0.0, verbose_name='Состояние счета')),
                ('memory_limit', models.FloatField(blank=True, null=True, verbose_name='Лимит хранилища')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='Название')),
                ('inn', models.BigIntegerField(blank=True, null=True, verbose_name='ИНН')),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('img', models.ImageField(blank=True, null=True, upload_to='media/', verbose_name='Изображение')),
                ('size', models.FloatField(blank=True, null=True, verbose_name='Размер файла')),
                ('length', models.IntegerField(blank=True, null=True, verbose_name='Длина')),
                ('width', models.IntegerField(blank=True, null=True, verbose_name='Ширина')),
                ('extension', models.CharField(blank=True, max_length=32, null=True, verbose_name='Расширение')),
                ('string_geodata', models.TextField(blank=True, null=True, verbose_name='Геоданные файла')),
                ('path', models.FilePathField(blank=True, null=True, verbose_name='Путь')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата загрузки')),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recognition.AdvUser', verbose_name='Пользователь')),
            ],
        ),
        migrations.CreateModel(
            name='ToolType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='No-name tool type', max_length=256, verbose_name='Название')),
                ('proc_geodata', models.BooleanField(default=False, verbose_name='Работа с геоданными')),
            ],
        ),
        migrations.CreateModel(
            name='Tool',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='No-name tool', max_length=256, verbose_name='Название')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Описание')),
                ('avatar', models.ImageField(blank=True, null=True, upload_to='static/static_images/', verbose_name='Аватар')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата изменения')),
                ('weights', models.FileField(blank=True, null=True, upload_to='static/weights/', verbose_name='Файл весов')),
                ('price', models.FloatField(default=0.0, verbose_name='Стоимость')),
                ('origin_path', models.FilePathField(blank=True, null=True, verbose_name='Директория из')),
                ('result_path', models.FilePathField(blank=True, null=True, verbose_name='Директория в')),
                ('tool_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recognition.ToolType', verbose_name='Тип модели')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('string_geodata', models.BooleanField(default=False, verbose_name='Обработать введенные геоданные')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('discount', models.FloatField(default=0.0, verbose_name='% скидки')),
                ('source_path', models.FilePathField(blank=True, null=True, verbose_name='Путь до сырья')),
                ('result_path', models.FilePathField(blank=True, null=True, verbose_name='Путь до результата')),
                ('start_datetime', models.DateTimeField(blank=True, null=True, verbose_name='Дата начала обработки')),
                ('finish_datetime', models.DateTimeField(blank=True, null=True, verbose_name='Дата окончания обработки')),
                ('success', models.BooleanField(null=True, verbose_name='Статус выполнения')),
                ('priority', models.SmallIntegerField(default=0, verbose_name='Приоритет')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Описание изображения')),
                ('img', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recognition.Image', verbose_name='Изображение')),
                ('tool', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recognition.Tool', verbose_name='Модель')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recognition.AdvUser', verbose_name='Пользователь')),
            ],
        ),
        migrations.AddField(
            model_name='advuser',
            name='company',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recognition.Company', verbose_name='Компания'),
        ),
        migrations.AddField(
            model_name='advuser',
            name='tools_list',
            field=models.ManyToManyField(blank=True, to='recognition.Tool', verbose_name='Список доступных моделей'),
        ),
    ]
