# Generated by Django 3.1.7 on 2021-03-19 18:47

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Person',
            fields=[
                ('person_id', models.AutoField(primary_key=True, serialize=False)),
                ('first_name', models.CharField(max_length=50, verbose_name='Имя')),
                ('last_name', models.CharField(max_length=50, verbose_name='Фамилия')),
                ('patronymic', models.CharField(blank=True, max_length=50, null=True)),
                ('bio', models.TextField(blank=True, null=True, validators=[django.core.validators.MinLengthValidator(10, message='Биография должна быть не короче 10 символов')])),
                ('email', models.EmailField(max_length=254, null=True, verbose_name='email адрес')),
                ('publications', models.TextField(blank=True, null=True)),
                ('photo', models.ImageField(blank=True, null=True, upload_to='uploads/')),
            ],
            options={
                'verbose_name': 'Преподаватель',
                'verbose_name_plural': 'Преподаватели',
                'ordering': ['-last_name'],
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('course_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(db_index=True, max_length=50, verbose_name='Наименование дисциплины')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Описание')),
                ('learning_outcomes', models.TextField(blank=True, null=True, verbose_name='Приобретаемые навыки')),
                ('mooc_url', models.URLField(error_messages={'invalid': 'Неправильно указан URL адрес'}, null=True)),
                ('person_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='persons.person', verbose_name='Преподаватель')),
            ],
            options={
                'verbose_name': 'Дисциплина',
                'verbose_name_plural': 'Дисциплины',
                'ordering': ['name'],
            },
        ),
    ]
