text: # Generated by Django 3.0.4 on 2020-03-22 13:29
  
  import DjangoUeditor.models
  import datetime
  from django.conf import settings
  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='Courses',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('title', models.CharField(max_length=255, verbose_name='课程名称')),
                  ('is_visible', models.BooleanField(default=False, help_text='课程不再被展示', verbose_name='是否可见')),
                  ('show_on_homepage', models.BooleanField(default=False, help_text='出现在首页部分', verbose_name='是否首页推荐')),
                  ('order', models.IntegerField(default=0, help_text='影响出现在首页的顺序', verbose_name='首页推荐排序')),
                  ('title_pic', models.ImageField(blank=True, upload_to='course/')),
                  ('description', models.TextField(blank=True, null=True)),
                  ('browse_times', models.IntegerField(default=0, verbose_name='浏览次数')),
                  ('grade', models.IntegerField(default=0, verbose_name='课程评分')),
                  ('grade_number', models.IntegerField(default=0, verbose_name='参与评分人数')),
                  ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                  ('duration', models.IntegerField(default=120, help_text='课程总时长，单位为分钟', verbose_name='课程总时长')),
                  ('teachers', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='老师')),
              ],
              options={
                  'verbose_name': '课程',
                  'verbose_name_plural': '课程',
              },
          ),
          migrations.CreateModel(
              name='Chapter',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('title', models.CharField(max_length=255, verbose_name='章节标题')),
                  ('order', models.IntegerField(default=0, verbose_name='章节排序')),
                  ('type', models.CharField(blank=True, max_length=255, null=True, verbose_name='章节类型')),
                  ('details', DjangoUeditor.models.UEditorField(default='', verbose_name='内容')),
                  ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Courses', verbose_name='所属课程')),
              ],
              options={
                  'verbose_name': '课程章节',
                  'verbose_name_plural': '课程章节',
              },
          ),
      ]
  