Exemplo n.º 1
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('course', '0003_auto_20181208_2040'),
    ]

    operations = [
        migrations.AddField(
            model_name='course',
            name='student',
            field=models.ManyToManyField(blank=True, related_name='courses_joined', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='course',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_user', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='attach',
            field=models.FileField(blank=True, upload_to=course.models.user_directory_path),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lesson', to='course.Course'),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lesson_user', to=settings.AUTH_USER_MODEL),
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('course', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('video', models.FileField(upload_to=course.models.user_directory_path)),
                ('description', models.TextField(blank=True)),
                ('attach', models.FileField(blank=True, upload_to=course.models.user_directory_path)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('order', course.fields.OrderField(blank=True)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lesson', to='course.Course')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lesson_user', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['order'],
            },
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('taggit', '0003_taggeditem_add_unique_index'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='分类')),
            ],
            options={
                'verbose_name': '分类',
                'verbose_name_plural': '分类',
            },
        ),
        migrations.CreateModel(
            name='UserDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='本名')),
                ('length', models.IntegerField(verbose_name='身高')),
                ('sex', models.CharField(max_length=2, verbose_name='性别')),
                ('detail', models.TextField(verbose_name='用户简介')),
                ('email', models.CharField(max_length=50, verbose_name='邮箱')),
                ('img', models.ImageField(upload_to='user', verbose_name='头像')),
                ('user', 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='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='文章标题')),
                ('img', models.ImageField(blank=True, null=True, upload_to=course.models.article_img_path, verbose_name='文章配图')),
                ('content', markdownx.models.MarkdownxField(verbose_name='内容')),
                ('abstract', markdownx.models.MarkdownxField(max_length=255, null=True, verbose_name='摘要')),
                ('visited', models.PositiveIntegerField(default=0, verbose_name='访问量')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='作者')),
                ('category', models.ManyToManyField(to='course.Category', verbose_name='文章分类')),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='标签')),
            ],
            options={
                'verbose_name': '文章内容',
                'verbose_name_plural': '文章内容',
                'ordering': ['-created_at'],
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='course',
            name='course_type',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='course.Type_category'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='course',
            name='language_type',
            field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='course.language_category'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='content',
            name='video',
            field=models.FileField(blank=True, null=True, upload_to='course_content', validators=[course.models.video_validator]),
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('user', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='课程名')),
                ('introduction', models.CharField(max_length=250, verbose_name='介绍')),
                ('credit', models.IntegerField(verbose_name='学分')),
                ('max_number', models.IntegerField(verbose_name='课程最大人数')),
                ('year', models.IntegerField(default=course.models.current_year, verbose_name='年份')),
                ('semester', models.CharField(choices=[('Autumn', '上'), ('Spring', '下')], max_length=5, verbose_name='学期')),
                ('start_select', models.BooleanField(default=False, verbose_name='开始选课')),
                ('end_select', models.BooleanField(default=False, verbose_name='结束选课')),
                ('is_end', models.BooleanField(default=False, verbose_name='是否结课')),
                ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Teacher', verbose_name='课程教师')),
            ],
        ),
        migrations.CreateModel(
            name='StudentCourse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('with_draw', models.BooleanField(default=False)),
                ('with_draw_time', models.DateTimeField(default=None, null=True)),
                ('scores', models.IntegerField(null=True, verbose_name='成绩')),
                ('comments', models.CharField(max_length=250, null=True, verbose_name='老师评价')),
                ('rating', models.IntegerField(null=True, verbose_name='学生评分')),
                ('assessment', models.CharField(max_length=250, null=True, verbose_name='学生评价')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Student')),
            ],
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('weekday', models.IntegerField(choices=[(1, '周一'), (2, '周二'), (3, '周三'), (4, '周四'), (5, '周五'), (6, '周六'), (7, '周日')], verbose_name='日期')),
                ('start_time', models.TimeField(verbose_name='上课时间')),
                ('end_time', models.TimeField(verbose_name='下课时间')),
                ('location', models.CharField(max_length=100, verbose_name='上课地点')),
                ('remarks', models.CharField(max_length=100, verbose_name='备注')),
                ('start_week', models.IntegerField(verbose_name='第几周开始')),
                ('end_week', models.IntegerField(verbose_name='第几周结束')),
                ('week_interval', models.IntegerField(choices=[(1, '无间隔'), (2, '每隔一周上一次')], default=1, verbose_name='周间隔')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course', verbose_name='课程名')),
            ],
        ),
    ]
Exemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('technology', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('url', models.URLField(blank=True, default='')),
                ('detail', ckeditor_uploader.fields.RichTextUploadingField()),
                ('logo',
                 models.ImageField(blank=True,
                                   upload_to=course.models.course_logo)),
                ('logo_url', models.URLField(blank=True, default='')),
                ('upvotes', models.IntegerField(blank=True, null=True)),
                ('free', models.BooleanField(default=True)),
                ('level',
                 models.CharField(choices=[('BEGINNER', 'Beginner'),
                                           ('INTERMEDIATE', 'Intermediate'),
                                           ('ADVANCED', 'Advanced')],
                                  default='Select',
                                  max_length=20)),
                ('submitter',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='submitter',
                                   to=settings.AUTH_USER_MODEL)),
                ('tech',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='technology.Technology')),
                ('tutor',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='tutor',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Exemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('description',
                 models.CharField(default='No description provide by teacher',
                                  max_length=1000)),
                ('image',
                 models.ImageField(
                     upload_to=course.models.get_upload_location)),
                ('tutor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='hosted_courses',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='EnrolledCourse',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='students',
                                   to='course.Course')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='enrolled_courses',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('user', 'course')},
            },
        ),
    ]
Exemplo n.º 8
0
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0015_auto_20191204_0253'),
    ]

    operations = [
        migrations.CreateModel(
            name='Contents',
            fields=[
                ('content_id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('file',
                 models.FileField(upload_to=course.models.gen_pic_path)),
                ('file_type', models.BooleanField()),
                ('serial', models.IntegerField()),
                ('title', models.CharField(max_length=200)),
                ('description', models.TextField()),
                ('course_idc',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='contents_course_id',
                                   to='course.Course')),
            ],
        ),
    ]
Exemplo n.º 9
0
class Migration(migrations.Migration):

    dependencies = [
        ('login', '0003_auto_20200426_1554'),
        ('course', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=128)),
                ('introduction', models.CharField(max_length=256, null=True)),
                ('likes', models.IntegerField(default=0)),
                ('downloads', models.IntegerField(default=0)),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='上传时间')),
                ('file',
                 models.FileField(
                     upload_to=course.models.file_directory_path)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='login.User')),
            ],
            options={
                'verbose_name': '文件',
                'verbose_name_plural': '文件',
                'ordering': ['-create_time'],
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0001_initial'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='category',
            options={
                'ordering': ['startdate'],
                'verbose_name_plural': 'Categories'
            },
        ),
        migrations.AlterModelOptions(
            name='resources',
            options={
                'verbose_name': 'Resources',
                'verbose_name_plural': 'Resources'
            },
        ),
        migrations.AddField(
            model_name='category',
            name='slug',
            field=models.SlugField(blank=True, max_length=200, unique=True),
        ),
        migrations.AlterField(
            model_name='submission',
            name='file',
            field=models.FileField(
                upload_to=course.models.upload_location_submission),
        ),
        migrations.AlterField(
            model_name='task',
            name='category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='category',
                to='course.category'),
        ),
    ]
Exemplo n.º 11
0
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0006_remove_stepcontent_picture'),
    ]

    operations = [
        migrations.CreateModel(
            name='CourseImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=course.models.CourseImage.get_upload_to)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='course.course')),
            ],
            options={
                'ordering': ('-date_created',),
            },
        ),
    ]
Exemplo n.º 12
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='TeachingPeriod',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('day', models.IntegerField()),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('course_id',
                 models.SlugField(default=course.models.random_course_code,
                                  unique=True)),
                ('name', models.CharField(max_length=255)),
                ('teacher_name', models.CharField(max_length=255)),
                ('status', models.BooleanField()),
                ('teaching_period',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.TeachingPeriod')),
            ],
        ),
    ]
Exemplo n.º 13
0
class Migration(migrations.Migration):
    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=128)),
                ('intro', models.TextField()),
                ('create_time',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('video',
                 models.FileField(
                     blank=True, upload_to=course.models.user_directory_path)),
                ('attach',
                 models.FileField(
                     blank=True, upload_to=course.models.user_directory_path)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='courses_user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-create_time', ),
            },
        ),
    ]
Exemplo n.º 14
0
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0001_initial'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='coupon',
            name='expire_date',
        ),
        migrations.RemoveField(
            model_name='module',
            name='file',
        ),
        migrations.RemoveField(
            model_name='subject',
            name='duration',
        ),
        migrations.AddField(
            model_name='course',
            name='duration',
            field=models.CharField(blank=True, max_length=20, null=True),
        ),
        migrations.AddField(
            model_name='course',
            name='price',
            field=models.IntegerField(blank=True, default=0, null=True),
        ),
        migrations.AddField(
            model_name='subject',
            name='class_type',
            field=models.CharField(blank=True, max_length=10, null=True),
        ),
        migrations.AddField(
            model_name='subject',
            name='created_at',
            field=models.DateTimeField(default=django.utils.timezone.now),
        ),
        migrations.AddField(
            model_name='subject',
            name='short_description',
            field=models.CharField(blank=True, max_length=300, null=True),
        ),
        migrations.AddField(
            model_name='subject',
            name='subject_type',
            field=models.CharField(blank=True, max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='course',
            name='course_cover',
            field=models.ImageField(
                blank=True,
                default='course_images/default.png',
                null=True,
                upload_to=course.models.Course.upload_location),
        ),
        migrations.AlterField(
            model_name='course',
            name='created_at',
            field=models.DateTimeField(default=django.utils.timezone.now),
        ),
        migrations.AlterField(
            model_name='subject',
            name='description',
            field=models.CharField(blank=True, max_length=500, null=True),
        ),
        migrations.AlterField(
            model_name='subject',
            name='subject_cover',
            field=models.ImageField(
                blank=True,
                default='subject_images/default.png',
                null=True,
                upload_to=course.models.Subject.upload_location),
        ),
        migrations.CreateModel(
            name='ModuleFile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file',
                 models.FileField(
                     null=True,
                     upload_to=course.models.ModuleFile.upload_location)),
                ('module',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Module')),
            ],
        ),
    ]
Exemplo n.º 15
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('short_description', models.TextField(default='')),
                ('startdate', models.DateTimeField()),
            ],
            options={
                'ordering': ['startdate'],
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 shortuuidfield.fields.ShortUUIDField(blank=True,
                                                      editable=False,
                                                      max_length=22,
                                                      unique=True)),
                ('title', models.CharField(max_length=100)),
                ('description', models.TextField(blank=True, default=None)),
                ('pdf_file',
                 models.FileField(
                     upload_to=course.models.upload_location,
                     validators=[
                         django.core.validators.FileExtensionValidator(
                             allowed_extensions=['pdf'])
                     ])),
                ('status',
                 models.IntegerField(choices=[(0, 'Draft'), (1, 'Publish')],
                                     default=0)),
                ('start_date',
                 models.DateTimeField(verbose_name='start_date')),
                ('last_date',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last_date')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.category')),
            ],
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file',
                 models.FileField(upload_to=course.models.upload_location)),
                ('comments', models.TextField(blank=True, null=True)),
                ('date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='submit_date')),
                ('account',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('task',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.task')),
            ],
        ),
        migrations.CreateModel(
            name='Resources',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('video_link', models.URLField()),
                ('video_title', models.CharField(max_length=100)),
                ('task',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.task')),
            ],
        ),
        migrations.CreateModel(
            name='Organiser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('contact', models.CharField(max_length=14)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.category')),
            ],
        ),
    ]
Exemplo n.º 16
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('title', models.CharField(blank=True, default='', max_length=255)),
                ('description', models.TextField()),
                ('lesson_index', models.PositiveSmallIntegerField()),
                ('content', models.TextField()),
                ('audio', models.FileField(upload_to=course.models.scramble_uploaded_filename, verbose_name='Uploaded Audio')),
                ('video_url', models.CharField(blank=True, default='', max_length=1000)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='LessonComplete',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('completed', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('current_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_who_complete', to=settings.AUTH_USER_MODEL)),
                ('lesson', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lesson_to_complete', to='course.Lesson')),
            ],
        ),
        migrations.CreateModel(
            name='Session',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('image', models.ImageField(upload_to=course.models.scramble_uploaded_filename, verbose_name='Uploaded image')),
                ('title', models.CharField(blank=True, default='', max_length=255)),
                ('description', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('title', models.CharField(blank=True, default='', max_length=255)),
                ('description', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.AddField(
            model_name='session',
            name='unit',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='unit_sessions', to='course.Unit'),
        ),
        migrations.AddField(
            model_name='lesson',
            name='session',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='session_lessons', to='course.Session'),
        ),
    ]
Exemplo n.º 17
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('subtitle', models.CharField(blank=True, max_length=200, null=True)),
                ('description', models.TextField(default='None')),
                ('doc_path', models.CharField(default='Documents', max_length=200)),
                ('author', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='course.author')),
            ],
        ),
        migrations.CreateModel(
            name='Chapter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.IntegerField()),
                ('title', models.CharField(max_length=200)),
                ('markdown', models.TextField()),
                ('html', models.TextField()),
                ('document', models.CharField(max_length=200)),
                ('book', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='course.book')),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('folder', models.CharField(default='book', max_length=100)),
                ('image', models.ImageField(blank=True, null=True, upload_to=course.models.get_upload)),
                ('title', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Note',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('text', models.TextField()),
                ('author', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='course.author')),
                ('chapter', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='course.chapter')),
            ],
        ),
        migrations.AddField(
            model_name='author',
            name='photo',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='course.image'),
        ),
        migrations.AddField(
            model_name='author',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
Exemplo n.º 18
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('course_name', models.CharField(max_length=200, unique=True)),
                ('fees', models.IntegerField(default=0)),
                ('studentEnrolled',
                 models.ManyToManyField(blank=True,
                                        default=None,
                                        related_name='enrolled_student',
                                        to=settings.AUTH_USER_MODEL)),
                ('teacherId',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='language_category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Type_category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('pub_date', models.DateTimeField(auto_now_add=True)),
                ('comment', models.CharField(max_length=200)),
                ('rating',
                 models.IntegerField(
                     choices=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5,
                                                                       '5')])),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='reviews',
                                   to='course.course')),
                ('user_name',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='reviewers',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='module',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('module_name',
                 models.CharField(max_length=100, verbose_name='Name')),
                ('Description', models.TextField()),
                ('course_associate',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.course')),
            ],
        ),
        migrations.CreateModel(
            name='Content',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('video',
                 models.FileField(upload_to='course_content',
                                  validators=[course.models.video_validator])),
                ('description', models.TextField()),
                ('is_description_content', models.BooleanField(default=0)),
                ('module_associated',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.module')),
            ],
        ),
    ]
Exemplo n.º 19
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('user', '0001_initial'),
        ('department', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('semester',
                 models.CharField(
                     choices=[('SEM_1', '1st Semester'),
                              ('SEM_2', '2nd Semester'),
                              ('SEM_3', '3rd Semester'),
                              ('SEM_4', '4th Semester'),
                              ('SEM_5', '5th Semester'),
                              ('SEM_6', '6th Semester'),
                              ('SEM_7', '7th Semester'),
                              ('SEM_8', '8th Semester')],
                     default=course.models.Semester('1st Semester'),
                     max_length=50)),
                ('name', models.CharField(max_length=50)),
                ('course_code', models.CharField(max_length=50)),
                ('max_marks', models.IntegerField()),
                ('credits', models.PositiveSmallIntegerField()),
                ('objective', models.TextField()),
                ('syllabus', models.TextField()),
                ('text_books', models.TextField()),
                ('ref_material', models.TextField()),
                ('prerequisite', models.TextField()),
                ('type', models.CharField(max_length=50)),
                ('duration', models.DurationField()),
                ('hours', models.DurationField()),
                ('updated_on', models.DateField()),
                ('department',
                 models.ForeignKey(on_delete=None,
                                   to='department.Department')),
            ],
        ),
        migrations.CreateModel(
            name='CourseAvailable',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('year', models.DateField()),
                ('active', models.BooleanField()),
                ('course', models.ForeignKey(on_delete=None,
                                             to='course.Course')),
                ('faculty', models.ForeignKey(on_delete=None, to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='CourseEnrollment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('year', models.PositiveSmallIntegerField()),
                ('course', models.ForeignKey(on_delete=None,
                                             to='course.Course')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='CourseFeedback',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('year', models.DateField()),
                ('active', models.BooleanField(default=False)),
                ('course', models.ForeignKey(on_delete=None,
                                             to='course.Course')),
            ],
        ),
        migrations.CreateModel(
            name='CourseOutcomes',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text', models.TextField()),
                ('course', models.ForeignKey(on_delete=None,
                                             to='course.Course')),
            ],
        ),
        migrations.CreateModel(
            name='FeedbackAnswer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('answer', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='FeedbackQuestion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('type',
                 models.CharField(
                     max_length=30,
                     verbose_name=[
                         (course.models.FeedbackQuestionType('True/False'),
                          'True/False'),
                         (course.models.FeedbackQuestionType(
                             'Multiple Choice'), 'Multiple Choice'),
                         (course.models.FeedbackQuestionType('Rating'),
                          'Rating')
                     ])),
                ('options', models.PositiveSmallIntegerField()),
                ('quesText', models.TextField()),
                ('order', models.PositiveSmallIntegerField()),
                ('feedback',
                 models.ForeignKey(on_delete=None,
                                   to='course.CourseFeedback')),
            ],
        ),
        migrations.AddField(
            model_name='feedbackanswer',
            name='question',
            field=models.ForeignKey(on_delete=None,
                                    to='course.FeedbackQuestion'),
        ),
        migrations.AddField(
            model_name='feedbackanswer',
            name='user',
            field=models.ForeignKey(on_delete=None, to='user.User'),
        ),
    ]
Exemplo n.º 20
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course_id', models.CharField(max_length=10, verbose_name='課程編號')),
                ('name', models.CharField(max_length=20, verbose_name='名稱')),
                ('start_time', models.DateField(verbose_name='起始時間')),
                ('end_time', models.DateField(verbose_name='結束時間')),
                ('students', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
                ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_tacher', to=settings.AUTH_USER_MODEL, verbose_name='授課教師')),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=30, verbose_name='作業標題')),
                ('text', models.TextField(verbose_name='內容')),
                ('post_time', models.DateTimeField(auto_now=True, null=True)),
                ('dead_time', models.DateTimeField(verbose_name='截止時間')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.course')),
            ],
            options={
                'ordering': ['-post_time'],
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('content', ckeditor_uploader.fields.RichTextUploadingField()),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('course', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='course.course')),
            ],
        ),
        migrations.CreateModel(
            name='Homework',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(blank=True, null=True, upload_to=course.models.user_directory_path)),
                ('update_date', models.DateTimeField(auto_now=True, verbose_name='上傳時間')),
                ('subject', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='course.subject', verbose_name='作業')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Grade',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('grade', models.FloatField(verbose_name='成績')),
                ('date_time', models.DateTimeField(auto_now=True, verbose_name='提交時間')),
                ('homework', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='course.homework')),
            ],
        ),
    ]
Exemplo n.º 21
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('taggit', '0002_auto_20150616_2121'),
        ('app', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=100)),
                ('slug', models.SlugField(blank=True, max_length=250, null=True)),
                ('title', models.TextField(blank=True, null=True)),
                ('content', tinymce.models.HTMLField(blank=True, null=True)),
                ('promotion', models.CharField(blank=True, max_length=50, null=True)),
                ('remark', models.CharField(blank=True, max_length=50, null=True)),
                ('days', models.IntegerField(default=0)),
                ('hours', models.IntegerField(default=0)),
                ('price', models.DecimalField(decimal_places=2, default=0, max_digits=15)),
                ('image', models.FileField(blank=True, null=True, upload_to=course.models.get_course_file)),
                ('published', models.BooleanField(default=True)),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Category')),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')),
                ('teachers', models.ManyToManyField(blank=True, to='app.Teacher')),
            ],
            options={
                'db_table': 'course',
                'verbose_name_plural': 'Course',
            },
        ),
        migrations.CreateModel(
            name='CourseOption',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('option', models.CharField(max_length=50)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course')),
            ],
            options={
                'db_table': 'course_option',
                'verbose_name_plural': 'CourseOption',
            },
        ),
        migrations.CreateModel(
            name='CourseSlider',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('image', models.FileField(blank=True, null=True, upload_to=course.models.get_course_slider_file)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course')),
            ],
            options={
                'db_table': 'course_slider',
                'verbose_name_plural': 'CourseSlider',
            },
        ),
    ]
Exemplo n.º 22
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Student',
            fields=[
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('username',
                 models.CharField(error_messages={'unique': '用户已存在'},
                                  max_length=30,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='学号')),
                ('password',
                 models.CharField(help_text='身份证号后8位',
                                  max_length=128,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          '^[0-9]{7}[a-z,A-X]{1}$|^[0-9]{8}$',
                                          '身份证号后8位', 'invalid')
                                  ],
                                  verbose_name='身份证号后8位')),
                ('is_staff',
                 models.BooleanField(default=False, verbose_name='管理员')),
                ('is_superuser',
                 models.BooleanField(default=False, verbose_name='超级管理员')),
                ('gender',
                 models.CharField(choices=[('M', '男'), ('F', '女')],
                                  max_length=5,
                                  verbose_name='性别')),
                ('course_cat',
                 models.CharField(blank=True,
                                  choices=[('pe1or2', '专项1或2'),
                                           ('pe3or4', '专项3或4')],
                                  default='',
                                  max_length=20,
                                  verbose_name='上课类别')),
                ('auto_match',
                 models.BooleanField(default=True, verbose_name='参与自动排课')),
            ],
            options={
                'verbose_name': '学生',
                'verbose_name_plural': '学生',
            },
            managers=[
                ('objects', course.models.StudentManager()),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('course_name',
                 models.CharField(max_length=200,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='课程名称')),
                ('day_slot',
                 models.CharField(choices=[('1', '周一'), ('2', '周二'),
                                           ('3', '周三'), ('4', '周四'),
                                           ('5', '周五')],
                                  max_length=5,
                                  verbose_name='上课日期')),
                ('time_slot',
                 models.CharField(choices=[('1', '第一大节'), ('2', '第二大节'),
                                           ('3', '第三大节'), ('4', '第四大节')],
                                  max_length=5,
                                  verbose_name='上课时间')),
                ('course_cat',
                 models.CharField(choices=[('pe1or2', '专项1或2'),
                                           ('pe3or4', '专项3或4')],
                                  max_length=20,
                                  verbose_name='课程类别')),
                ('gender',
                 models.CharField(choices=[('M', '男'), ('F', '女'),
                                           ('B', '均可')],
                                  max_length=5,
                                  verbose_name='性别要求')),
                ('cur_number',
                 models.IntegerField(default=0, verbose_name='已注册人数')),
                ('max_number',
                 models.IntegerField(default=100, verbose_name='最大容量')),
                ('add_number',
                 models.IntegerField(default=0, verbose_name='排课新增人数')),
                ('auto_match',
                 models.BooleanField(default=True, verbose_name='参与自动排课')),
            ],
            options={
                'verbose_name': '课程',
                'verbose_name_plural': '课程',
            },
        ),
        migrations.CreateModel(
            name='Selection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('day_slot',
                 models.CharField(choices=[('1', '周一'), ('2', '周二'),
                                           ('3', '周三'), ('4', '周四'),
                                           ('5', '周五')],
                                  max_length=5,
                                  verbose_name='星期几')),
                ('time_slot',
                 models.CharField(choices=[('1', '第一大节'), ('2', '第二大节'),
                                           ('3', '第三大节'), ('4', '第四大节')],
                                  max_length=5,
                                  verbose_name='时间')),
                ('student',
                 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='SpecialReq',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=50,
                                  unique=True,
                                  verbose_name='名称')),
                ('description',
                 models.TextField(max_length=200, verbose_name='介绍')),
            ],
            options={
                'verbose_name': '课程特殊要求',
                'verbose_name_plural': '课程特殊要求',
            },
        ),
        migrations.CreateModel(
            name='StudentReq',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('special_req',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.SpecialReq',
                                   verbose_name='特殊要求')),
                ('student',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='学生')),
            ],
            options={
                'verbose_name': '学生特殊要求',
                'verbose_name_plural': '学生特殊要求',
            },
        ),
        migrations.AddField(
            model_name='course',
            name='special_req',
            field=models.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='course.SpecialReq',
                verbose_name='特殊要求'),
        ),
        migrations.AddField(
            model_name='student',
            name='course',
            field=models.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='course.Course',
                verbose_name='排课'),
        ),
        migrations.AddField(
            model_name='student',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='student',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
        migrations.AlterUniqueTogether(
            name='studentreq',
            unique_together=set([('student', 'special_req')]),
        ),
        migrations.AlterUniqueTogether(
            name='selection',
            unique_together=set([('student', 'day_slot', 'time_slot')]),
        ),
    ]
Exemplo n.º 23
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Chapter',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_index', models.IntegerField(null=True,
                                                   verbose_name='章节')),
                ('title', models.CharField(max_length=256)),
            ],
            options={
                'verbose_name_plural': '章节列表',
            },
        ),
        migrations.CreateModel(
            name='CourseData',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('course_classification',
                 models.IntegerField(choices=[(0, '普通课程'), (1, '微课'),
                                              (2, 'Demo'), (3, '总量')],
                                     verbose_name='课程类型')),
            ],
            options={
                'verbose_name': '课程数据',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.CharField(max_length=64,
                                             verbose_name='标签')),
            ],
            options={
                'verbose_name': '标签',
            },
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=256, verbose_name='标题')),
                ('sort_index', models.IntegerField(null=True,
                                                   verbose_name='课时')),
                ('is_video',
                 models.BooleanField(default=True,
                                     null=True,
                                     verbose_name='是否为视频')),
                ('video',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='课程视频')),
                ('video_length',
                 models.CharField(blank=True,
                                  max_length=16,
                                  null=True,
                                  verbose_name='视频长度')),
                ('content',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='图文内容(markdown)')),
                ('is_free',
                 models.BooleanField(default=False, verbose_name='是否免费')),
                ('chapter',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='lectures',
                                   to='course.Chapter')),
            ],
            options={
                'verbose_name_plural': '课时列表',
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('target',
                 models.CharField(choices=[('course', '课程'), ('micro', '微课'),
                                           ('demo', 'Demo')],
                                  default='course',
                                  max_length=12,
                                  verbose_name='课程类型')),
                ('user', models.IntegerField(verbose_name='上传用户ID')),
                ('title',
                 models.CharField(max_length=128, null=True,
                                  verbose_name='标题')),
                ('brief', models.TextField(default='', verbose_name='课程简介')),
                ('desc',
                 models.TextField(blank=True, null=True, verbose_name='课程介绍')),
                ('thumbnail',
                 models.CharField(blank=True,
                                  max_length=256,
                                  null=True,
                                  verbose_name='课程图')),
                ('is_video',
                 models.BooleanField(default=True,
                                     null=True,
                                     verbose_name='视频课程')),
                ('video',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=128,
                                  verbose_name='视频地址')),
                ('video_length',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=16,
                                  verbose_name='视频长度')),
                ('content',
                 models.TextField(blank=True,
                                  default='',
                                  verbose_name='图文内容(markdown)')),
                ('original_price',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='原价')),
                ('current_price',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='现价')),
                ('created',
                 models.DateTimeField(auto_now_add=True, verbose_name='上传时间')),
                ('status',
                 models.BooleanField(blank=True,
                                     default=False,
                                     null=True,
                                     verbose_name='是否上架')),
                ('sale_earnings',
                 models.DecimalField(decimal_places=2,
                                     default=0.8,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='分销收益')),
                ('share_earnings',
                 models.DecimalField(decimal_places=2,
                                     default=0.05,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='分享收益')),
                ('share_discount',
                 models.DecimalField(decimal_places=2,
                                     default=0.6,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='分享折扣')),
                ('promotion_expire',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='优惠到期时间')),
                ('is_promoted',
                 models.BooleanField(default=False, verbose_name='是否加入促销')),
                ('display_hot',
                 models.IntegerField(default=300,
                                     null=True,
                                     verbose_name='显示热度')),
                ('real_hot',
                 models.IntegerField(default=0, null=True,
                                     verbose_name='真实热度')),
                ('display_rank',
                 models.DecimalField(decimal_places=2,
                                     default=4.0,
                                     max_digits=10,
                                     verbose_name='显示评分')),
                ('real_rank',
                 models.DecimalField(decimal_places=2,
                                     default=0.0,
                                     max_digits=10,
                                     verbose_name='真实评分')),
                ('study_count',
                 models.IntegerField(default=0, verbose_name='学习人数')),
                ('favour_count',
                 models.IntegerField(default=0, verbose_name='收藏人数')),
                ('comment_count',
                 models.IntegerField(default=0, verbose_name='评论人数')),
                ('lecture_count',
                 models.IntegerField(default=0, verbose_name='课时数')),
                ('tech',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=256,
                                  null=True,
                                  verbose_name='技术栈')),
                ('env',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=256,
                                  null=True,
                                  verbose_name='运行环境')),
                ('banner',
                 models.CharField(blank=True,
                                  max_length=256,
                                  null=True,
                                  verbose_name='课程横幅')),
                ('video_status',
                 models.BooleanField(default=False, verbose_name='转码完成')),
                ('upload_thumbnail',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=course.models.UploadTo('thumbnail/'),
                     verbose_name='上传课程图')),
                ('upload_banner',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=course.models.UploadTo('banner/'),
                                   verbose_name='banner')),
                ('tag',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='courses',
                     to='course.Tag',
                     verbose_name='标签')),
            ],
            options={
                'verbose_name_plural': '课程列表',
            },
        ),
        migrations.AddField(
            model_name='chapter',
            name='course',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='chapters',
                to='course.Course'),
        ),
    ]
Exemplo n.º 24
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(max_length=30)),
                ('image', models.ImageField(upload_to=course.models.uploadImage)),
            ],
            options={
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('description', models.TextField(max_length=2000, null=True)),
                ('create_at', models.DateTimeField(auto_now_add=True)),
                ('cover', models.ImageField(upload_to=course.models.uploadImage)),
                ('price', models.FloatField()),
                ('rate', models.FloatField(default=0.0)),
                ('numReviewers', models.IntegerField(default=0)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='course.Category')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Course_owner', to=settings.AUTH_USER_MODEL)),
                ('students', models.ManyToManyField(blank=True, related_name='Course_students', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Rater',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stars', models.FloatField(default=0.0)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('rate_on', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('video', models.FileField(upload_to=course.models.uploadVideo)),
                ('thumbnail', models.ImageField(null=True, upload_to=course.models.uploadThumbnail)),
                ('lessonNum', models.IntegerField(default=1)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Reviewer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment', models.CharField(max_length=200)),
                ('comment_on', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='course.Course')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('rate', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='course.Rater')),
            ],
        ),
    ]
Exemplo n.º 25
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('school', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('serialnumber',
                 models.CharField(blank=True,
                                  max_length=50,
                                  null=True,
                                  unique=True)),
                ('number', models.SmallIntegerField(blank=True, null=True)),
                ('title',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('time', models.CharField(blank=True,
                                          max_length=400,
                                          null=True)),
                ('location',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('schoolterm',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('department',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'departmentid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='school.Department')),
                ('major',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'majorid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='school.Major')),
                ('teachclass',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'teachclassid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='school.Class')),
                ('teachers', models.ManyToManyField(to='school.Teacher')),
            ],
            options={
                'db_table': 'Course',
            },
        ),
        migrations.CreateModel(
            name='Coursehomework',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('instruction', models.TextField(blank=True, null=True)),
                ('type', models.SmallIntegerField(blank=True, null=True)),
                ('deadline', models.DateTimeField(blank=True, null=True)),
                ('weight', models.SmallIntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'CourseHomework',
            },
        ),
        migrations.CreateModel(
            name='Courseresource',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('uploadtime', models.DateTimeField(blank=True, null=True)),
                ('file',
                 models.FileField(
                     upload_to=course.models.get_courseresource_path)),
                ('course',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'courseid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='course.Course')),
            ],
            options={
                'db_table': 'CourseResource',
            },
        ),
        migrations.CreateModel(
            name='Homeworkcommit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('submittime', models.DateTimeField(blank=True, null=True)),
                ('text', models.TextField(blank=True, null=True)),
                ('score', models.SmallIntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'HomeworkCommit',
            },
        ),
        migrations.CreateModel(
            name='Homeworkfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('file', models.FileField(upload_to=b'homeworkfile')),
            ],
            options={
                'db_table': 'HomeworkFile',
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('length', models.SmallIntegerField(blank=True, null=True)),
                ('status', models.SmallIntegerField(blank=True, null=True)),
                ('year', models.SmallIntegerField(blank=True, null=True)),
                ('term', models.CharField(blank=True, max_length=20,
                                          null=True)),
                ('week', models.SmallIntegerField(blank=True, null=True)),
                ('time', models.SmallIntegerField(blank=True, null=True)),
                ('day', models.SmallIntegerField(blank=True, null=True)),
                ('starttime', models.DateTimeField(blank=True, null=True)),
                ('endtime', models.DateTimeField(blank=True, null=True)),
                ('checkincount', models.SmallIntegerField(blank=True,
                                                          null=True)),
                ('date', models.DateField(blank=True, null=True)),
                ('classroom',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'classroomid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='school.Classroom')),
                ('course',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'courseid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='course.Course')),
            ],
            options={
                'db_table': 'Lesson',
            },
        ),
        migrations.CreateModel(
            name='Studentcourse',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('course',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'courseid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='courses',
                     to='course.Course')),
                ('student',
                 models.ForeignKey(
                     blank=True,
                     db_column=b'studentid',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='school.Student')),
            ],
            options={
                'db_table': 'StudentCourse',
            },
        ),
        migrations.AddField(
            model_name='homeworkcommit',
            name='attachment',
            field=models.ManyToManyField(to='course.Homeworkfile'),
        ),
        migrations.AddField(
            model_name='homeworkcommit',
            name='coursehomework',
            field=models.ForeignKey(
                blank=True,
                db_column=b'coursehomeworkid',
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='course.Coursehomework'),
        ),
        migrations.AddField(
            model_name='homeworkcommit',
            name='student',
            field=models.ForeignKey(
                blank=True,
                db_column=b'studentid',
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='school.Student'),
        ),
        migrations.AddField(
            model_name='coursehomework',
            name='attachment',
            field=models.ManyToManyField(to='course.Homeworkfile'),
        ),
        migrations.AddField(
            model_name='coursehomework',
            name='course',
            field=models.ForeignKey(
                blank=True,
                db_column=b'courseid',
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='course.Course'),
        ),
        migrations.AlterUniqueTogether(
            name='studentcourse',
            unique_together=set([('student', 'course')]),
        ),
        migrations.AlterUniqueTogether(
            name='homeworkcommit',
            unique_together=set([('coursehomework', 'student')]),
        ),
    ]
Exemplo n.º 26
0
class Migration(migrations.Migration):

    dependencies = [
        ('userprofile', '0006_auto_20210812_1536'),
        ('course', '0050_enrollment_roles'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='course',
            options={
                'verbose_name': 'MODEL_NAME_COURSE',
                'verbose_name_plural': 'MODEL_NAME_COURSE_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='coursehook',
            options={
                'verbose_name': 'MODEL_NAME_COURSE_HOOK',
                'verbose_name_plural': 'MODEL_NAME_COURSE_HOOK_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='courseinstance',
            options={
                'verbose_name': 'MODEL_NAME_COURSE_INSTANCE',
                'verbose_name_plural': 'MODEL_NAME_COURSE_INSTANCE_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='coursemodule',
            options={
                'ordering': ['order', 'closing_time', 'id'],
                'verbose_name': 'MODEL_NAME_COURSE_MODULE',
                'verbose_name_plural': 'MODEL_NAME_COURSE_MODULE_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='enrollment',
            options={
                'verbose_name': 'MODEL_NAME_ENROLLMENT',
                'verbose_name_plural': 'MODEL_NAME_ENROLLMENT_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='hardcodedusertag',
            options={
                'verbose_name': 'MODEL_NAME_HARDCODED_USER_TAG',
                'verbose_name_plural': 'MODEL_NAME_HARDCODED_USER_TAG_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='learningobjectcategory',
            options={
                'verbose_name': 'MODEL_NAME_LEARNING_OBJECT_CATEGORY',
                'verbose_name_plural':
                'MODEL_NAME_LEARNING_OBJECT_CATEGORY_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='studentgroup',
            options={
                'ordering': ['course_instance', 'timestamp'],
                'verbose_name': 'MODEL_NAME_STUDENT_GROUP',
                'verbose_name_plural': 'MODEL_NAME_STUDENT_GROUP_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='usertag',
            options={
                'ordering': ['course_instance', 'name'],
                'verbose_name': 'MODEL_NAME_USER_TAG',
                'verbose_name_plural': 'MODEL_NAME_USER_TAG_PLURAL'
            },
        ),
        migrations.AlterModelOptions(
            name='usertagging',
            options={
                'ordering': ['tag'],
                'verbose_name': 'MODEL_NAME_USER_TAGGING',
                'verbose_name_plural': 'MODEL_NAME_USER_TAGGING_PLURAL'
            },
        ),
        migrations.AlterField(
            model_name='course',
            name='code',
            field=models.CharField(max_length=255, verbose_name='LABEL_CODE'),
        ),
        migrations.AlterField(
            model_name='course',
            name='name',
            field=models.CharField(max_length=255, verbose_name='LABEL_NAME'),
        ),
        migrations.AlterField(
            model_name='course',
            name='url',
            field=models.CharField(
                help_text='COURSE_URL_IDENTIFIER_HELPTEXT',
                max_length=255,
                unique=True,
                validators=[
                    django.core.validators.RegexValidator(
                        message='URL_KEY_MAY_CONSIST_OF',
                        regex=re.compile('^\\w[\\w\\-\\.]*$'))
                ],
                verbose_name='LABEL_URL'),
        ),
        migrations.AlterField(
            model_name='coursehook',
            name='course_instance',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='course_hooks',
                to='course.courseinstance',
                verbose_name='LABEL_COURSE_INSTANCE'),
        ),
        migrations.AlterField(
            model_name='coursehook',
            name='hook_type',
            field=models.CharField(choices=[('post-grading', 'Post grading')],
                                   default='post-grading',
                                   max_length=12,
                                   verbose_name='LABEL_HOOK_TYPE'),
        ),
        migrations.AlterField(
            model_name='coursehook',
            name='hook_url',
            field=models.URLField(verbose_name='LABEL_HOOK_URL'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='archive_time',
            field=models.DateTimeField(blank=True,
                                       null=True,
                                       verbose_name='LABEL_ARCHIVE_TIME'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='content_numbering',
            field=models.IntegerField(choices=[(0, 'NUMBERING_NONE'),
                                               (1, 'NUMBERING_ARABIC'),
                                               (2, 'NUMBERING_ROMAN'),
                                               (3, 'NUMBERING_HIDDEN_ARABIC')],
                                      default=1,
                                      verbose_name='LABEL_CONTENT_NUMBERING'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='course',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='instances',
                to='course.course',
                verbose_name='LABEL_COURSE'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='description',
            field=models.TextField(blank=True,
                                   verbose_name='LABEL_DESCRIPTION'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='ending_time',
            field=models.DateTimeField(verbose_name='LABEL_ENDING_TIME'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='enrollment_audience',
            field=models.IntegerField(
                choices=[(1, 'INTERNAL_USERS'), (2, 'EXTERNAL_USERS'),
                         (3, 'ALL_USERS')],
                default=1,
                verbose_name='LABEL_ENROLLMENT_AUDIENCE'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='enrollment_ending_time',
            field=models.DateTimeField(
                blank=True,
                null=True,
                verbose_name='LABEL_ENROLLMENT_ENDING_TIME'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='enrollment_starting_time',
            field=models.DateTimeField(
                blank=True,
                null=True,
                verbose_name='LABEL_ENROLLMENT_STARTING_TIME'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='footer',
            field=models.TextField(blank=True, verbose_name='LABEL_FOOTER'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='head_urls',
            field=models.TextField(
                blank=True,
                help_text=
                'COURSE_INSTANCE_EXTERNAL_CSS_AND_JS_FOR_ALL_PAGES_HELPTEXT',
                verbose_name='LABEL_HEAD_URLS'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='image',
            field=models.ImageField(blank=True,
                                    null=True,
                                    upload_to=course.models.build_upload_dir,
                                    verbose_name='LABEL_IMAGE'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='index_mode',
            field=models.IntegerField(
                choices=[(0, 'USER_RESULTS'), (1, 'TABLE_OF_CONTENTS'),
                         (2, 'LAST_VISITED_LINK'), (10, 'EXPERIMENTAL_SETUP')],
                default=0,
                help_text='COURSE_INSTANCE_INDEX_CONTENT_SELECTION_HELPTEXT',
                verbose_name='LABEL_INDEX_MODE'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='instance_name',
            field=models.CharField(max_length=255,
                                   verbose_name='LABEL_INSTANCE_NAME'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='language',
            field=models.CharField(blank=True,
                                   default='',
                                   max_length=255,
                                   verbose_name='LABEL_LANGUAGE'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='lifesupport_time',
            field=models.DateTimeField(blank=True,
                                       null=True,
                                       verbose_name='LABEL_LIFESUPPORT_TIME'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='module_numbering',
            field=models.IntegerField(choices=[(0, 'NUMBERING_NONE'),
                                               (1, 'NUMBERING_ARABIC'),
                                               (2, 'NUMBERING_ROMAN'),
                                               (3, 'NUMBERING_HIDDEN_ARABIC')],
                                      default=1,
                                      verbose_name='LABEL_MODULE_NUMBERING'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='starting_time',
            field=models.DateTimeField(verbose_name='LABEL_STARTING_TIME'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='technical_error_emails',
            field=models.CharField(
                blank=True,
                help_text=
                'COURSE_INSTANCE_EXERCISE_ERROR_EMAIL_RECIPIENT_OVERRIDE_HELPTEXT',
                max_length=255,
                verbose_name='LABEL_TECHNICAL_ERROR_EMAILS'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='url',
            field=models.CharField(
                help_text='COURSE_INSTANCE_URL_IDENTIFIER_HELPTEXT',
                max_length=255,
                validators=[
                    django.core.validators.RegexValidator(
                        message='URL_KEY_MAY_CONSIST_OF',
                        regex=re.compile('^\\w[\\w\\-\\.]*$'))
                ],
                verbose_name='LABEL_URL'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='view_content_to',
            field=models.IntegerField(choices=[(1, 'ENROLLED_STUDENTS'),
                                               (2, 'ENROLLMENT_AUDIENCE'),
                                               (3, 'ALL_REGISTERED_USERS'),
                                               (4, 'PUBLIC')],
                                      default=1,
                                      verbose_name='LABEL_VIEW_CONTENT_TO'),
        ),
        migrations.AlterField(
            model_name='courseinstance',
            name='visible_to_students',
            field=models.BooleanField(
                default=True, verbose_name='LABEL_VISIBLE_TO_STUDENTS'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='closing_time',
            field=models.DateTimeField(
                default=django.utils.timezone.now,
                help_text='MODULE_CLOSING_TIME_HELPTEXT',
                verbose_name='LABEL_CLOSING_TIME'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='course_instance',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='course_modules',
                to='course.courseinstance',
                verbose_name='LABEL_COURSE_INSTANCE'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='introduction',
            field=models.TextField(blank=True,
                                   verbose_name='LABEL_INTRODUCTION'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='late_submission_deadline',
            field=models.DateTimeField(
                default=django.utils.timezone.now,
                verbose_name='LABEL_LATE_SUBMISSION_DEADLINE'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='late_submission_penalty',
            field=lib.fields.PercentField(
                default=0.5,
                help_text='MODULE_LATE_SUBMISSION_PENALTY_HELPTEXT',
                verbose_name='LABEL_LATE_SUBMISSION_PENALTY'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='late_submissions_allowed',
            field=models.BooleanField(
                default=False, verbose_name='LABEL_LATE_SUBMISSIONS_ALLOWED'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='name',
            field=models.CharField(max_length=255, verbose_name='LABEL_NAME'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='opening_time',
            field=models.DateTimeField(
                default=django.utils.timezone.now,
                verbose_name='LABEL_EXERCISE_OPENING_TIME'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='order',
            field=models.IntegerField(default=1, verbose_name='LABEL_ORDER'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='points_to_pass',
            field=models.PositiveIntegerField(
                default=0, verbose_name='LABEL_POINTS_TO_PASS'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='reading_opening_time',
            field=models.DateTimeField(
                blank=True,
                help_text='MODULE_READING_OPENING_TIME_HELPTEXT',
                null=True,
                verbose_name='LABEL_READING_OPENING_TIME'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='status',
            field=models.CharField(choices=[('hidden', 'STATUS_HIDDEN'),
                                            ('maintenance',
                                             'STATUS_MAINTENANCE'),
                                            ('ready', 'STATUS_READY'),
                                            ('unlisted', 'STATUS_UNLISTED')],
                                   default='ready',
                                   max_length=32,
                                   verbose_name='LABEL_STATUS'),
        ),
        migrations.AlterField(
            model_name='coursemodule',
            name='url',
            field=models.CharField(
                help_text='MODULE_URL_IDENTIFIER_HELPTEXT',
                max_length=255,
                validators=[
                    django.core.validators.RegexValidator(
                        message='URL_KEY_MAY_CONSIST_OF',
                        regex=re.compile('^\\w[\\w\\-\\.]*$'))
                ],
                verbose_name='LABEL_URL'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='anon_id',
            field=models.CharField(blank=True,
                                   max_length=50,
                                   null=True,
                                   unique=True,
                                   verbose_name='LABEL_ANON_ID'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='anon_name',
            field=models.CharField(blank=True,
                                   default='',
                                   max_length=50,
                                   verbose_name='LABEL_ANON_NAME'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='course_instance',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='course.courseinstance',
                verbose_name='LABEL_COURSE_INSTANCE'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='language',
            field=models.CharField(blank=True,
                                   default='',
                                   max_length=5,
                                   verbose_name='LABEL_LANGUAGE'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='personal_code',
            field=models.CharField(blank=True,
                                   default='',
                                   max_length=10,
                                   verbose_name='LABEL_PERSONAL_CODE'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='role',
            field=models.IntegerField(choices=[(1, 'STUDENT'),
                                               (2, 'ASSISTANT'),
                                               (3, 'TEACHER')],
                                      default=1,
                                      verbose_name='LABEL_ROLE'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='selected_group',
            field=models.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='course.studentgroup',
                verbose_name='LABEL_SELECTED_GROUP'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='status',
            field=models.IntegerField(choices=[(1, 'ACTIVE'), (2, 'REMOVED'),
                                               (3, 'BANNED')],
                                      default=1,
                                      verbose_name='LABEL_STATUS'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='timestamp',
            field=models.DateTimeField(auto_now_add=True,
                                       verbose_name='LABEL_TIMESTAMP'),
        ),
        migrations.AlterField(
            model_name='enrollment',
            name='user_profile',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='userprofile.userprofile',
                verbose_name='LABEL_USER_PROFILE'),
        ),
        migrations.AlterField(
            model_name='learningobjectcategory',
            name='accept_unofficial_submits',
            field=models.BooleanField(
                default=False,
                help_text=
                'LEARNING_OBJECT_CATEGORY_ACCEPT_UNOFFICIAL_SUBMISSIONS_HELPTEXT',
                verbose_name='LABEL_ACCEPT_UNOFFICIAL_SUBMITS'),
        ),
        migrations.AlterField(
            model_name='learningobjectcategory',
            name='confirm_the_level',
            field=models.BooleanField(
                default=False,
                help_text=
                'LEARNING_OBJECT_CATEGORY_LEVEL_CONFIRMATION_EXERCISE_HELPTEXT',
                verbose_name='LABEL_CONFIRM_THE_LEVEL'),
        ),
        migrations.AlterField(
            model_name='learningobjectcategory',
            name='course_instance',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='categories',
                to='course.courseinstance',
                verbose_name='LABEL_COURSE_INSTANCE'),
        ),
        migrations.AlterField(
            model_name='learningobjectcategory',
            name='description',
            field=models.TextField(blank=True,
                                   verbose_name='LABEL_DESCRIPTION'),
        ),
        migrations.AlterField(
            model_name='learningobjectcategory',
            name='name',
            field=models.CharField(max_length=255, verbose_name='LABEL_NAME'),
        ),
        migrations.AlterField(
            model_name='learningobjectcategory',
            name='points_to_pass',
            field=models.PositiveIntegerField(
                default=0, verbose_name='LABEL_POINTS_TO_PASS'),
        ),
        migrations.AlterField(
            model_name='learningobjectcategory',
            name='status',
            field=models.CharField(choices=[('hidden', 'STATUS_HIDDEN'),
                                            ('nototal',
                                             'STATUS_NO_TOTAL_POINTS'),
                                            ('ready', 'STATUS_READY')],
                                   default='ready',
                                   max_length=32,
                                   verbose_name='LABEL_STATUS'),
        ),
        migrations.AlterField(
            model_name='studentgroup',
            name='course_instance',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='groups',
                to='course.courseinstance',
                verbose_name='LABEL_COURSE_INSTANCE'),
        ),
        migrations.AlterField(
            model_name='studentgroup',
            name='members',
            field=models.ManyToManyField(related_name='groups',
                                         to='userprofile.UserProfile',
                                         verbose_name='LABEL_MEMBERS'),
        ),
        migrations.AlterField(
            model_name='studentgroup',
            name='timestamp',
            field=models.DateTimeField(auto_now_add=True,
                                       verbose_name='LABEL_TIMESTAMP'),
        ),
        migrations.AlterField(
            model_name='usertag',
            name='course_instance',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='usertags',
                to='course.courseinstance',
                verbose_name='LABEL_COURSE_INSTANCE'),
        ),
        migrations.AlterField(
            model_name='usertag',
            name='visible_to_students',
            field=models.BooleanField(
                default=False, verbose_name='LABEL_VISIBLE_TO_STUDENTS'),
        ),
        migrations.AlterField(
            model_name='usertagging',
            name='course_instance',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='taggings',
                to='course.courseinstance',
                verbose_name='LABEL_COURSE_INSTANCE'),
        ),
        migrations.AlterField(
            model_name='usertagging',
            name='tag',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='taggings',
                to='course.usertag',
                verbose_name='LABEL_TAG'),
        ),
        migrations.AlterField(
            model_name='usertagging',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='taggings',
                to='userprofile.userprofile',
                verbose_name='LABEL_USER'),
        ),
    ]
Exemplo n.º 27
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('course_name', models.CharField(default=None,
                                                 max_length=300)),
                ('course_description', models.TextField(null=True)),
                ('course_cover',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=course.models.Course.upload_location)),
                ('created_at',
                 models.DateField(default=datetime.date(2020, 11, 17))),
                ('author',
                 models.ForeignKey(default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='account.TeacherProfile')),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subject_name', models.CharField(max_length=200, null=True)),
                ('subject_cover',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=course.models.Subject.upload_location)),
                ('duration',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('description',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('author',
                 models.ForeignKey(default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='account.TeacherProfile')),
            ],
        ),
        migrations.CreateModel(
            name='Module',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('module_name', models.CharField(max_length=100)),
                ('module_content', models.CharField(max_length=100)),
                ('file',
                 models.FileField(
                     null=True,
                     upload_to=course.models.Module.upload_location)),
                ('course',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='modules',
                                   to='course.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Enrollment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('enroll_key',
                 models.CharField(default='Text here',
                                  max_length=100,
                                  null=True)),
                ('course',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='enrollment',
                                   to='course.Course')),
                ('student',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='account.StudentProfile')),
            ],
        ),
        migrations.AddField(
            model_name='course',
            name='subject',
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='course.Subject'),
        ),
        migrations.CreateModel(
            name='Coupon',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('coupon_key', models.CharField(max_length=100, null=True)),
                ('isValid', models.BooleanField(default=True)),
                ('isIssued', models.BooleanField(default=False)),
                ('expire_date',
                 models.DateField(null=True, verbose_name='expire_date')),
                ('course',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course')),
            ],
        ),
    ]
Exemplo n.º 28
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('avatar',
                 models.ImageField(
                     upload_to=course.models.user_directory_path)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('image',
                 models.ImageField(
                     upload_to=course.models.course_directory_path)),
                ('start_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('end_date',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('slug', models.SlugField(max_length=250)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='blog_posts',
                                   to=settings.AUTH_USER_MODEL)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.category',
                                   verbose_name='Category')),
            ],
        ),
    ]
Exemplo n.º 29
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=500)),
                ('poster',
                 models.ImageField(
                     help_text=
                     'Please upload a cover picture for your lecture slides.',
                     upload_to='poster/')),
                ('skills',
                 models.CharField(choices=[('beginner', 'Beginner'),
                                           ('intermidate', 'Intermidate'),
                                           ('advance', 'Advance')],
                                  max_length=25)),
                ('powerpoint_slides',
                 models.FileField(
                     blank=True,
                     help_text='Please upload your powerpoint slides here.',
                     null=True,
                     upload_to='powerpoint/')),
                ('powerpoint_url',
                 models.URLField(
                     blank=True,
                     help_text='Please upload your powerpoint slides here.',
                     null=True)),
                ('price',
                 models.IntegerField(
                     blank=True,
                     help_text=
                     'Leave the table blank if the course is free of cost.',
                     null=True)),
                ('created', models.DateTimeField(auto_now_add=True,
                                                 null=True)),
                ('modified', models.DateTimeField(auto_now=True, null=True)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Category')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Verification',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('qualification',
                 models.FileField(
                     help_text=
                     'Upload a proof for your verification to become an instructor.',
                     null=True,
                     upload_to='documents/')),
                ('verify', models.BooleanField(default=False)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('lecture_title',
                 models.CharField(
                     help_text='eg: Lecture 1: Introduction to computer',
                     max_length=500)),
                ('lecture_content',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to='lecture video/',
                     validators=[course.models.validate_file_size])),
                ('youtube_url',
                 models.URLField(
                     blank=True,
                     help_text='Link of youtube url that you want to upload',
                     null=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.TextField(max_length=200)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course')),
                ('reply',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='replies',
                                   to='course.Comment')),
                ('user',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Exemplo n.º 30
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('user', '0001_initial'),
        ('base', '0003_auto_20190722_1659'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=1,
                                  max_length=128,
                                  verbose_name='课程名称')),
                ('detail', models.TextField(verbose_name='课程详情')),
                ('degree',
                 models.IntegerField(choices=[(0, '无'), (1, '本科')],
                                     default=0,
                                     verbose_name='参考学历')),
                ('click_count',
                 models.IntegerField(default=0, verbose_name='点击数')),
                ('per', models.FloatField(verbose_name='完成的金币反馈率')),
                ('putaway_time',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='上架时间')),
                ('poster',
                 models.ImageField(blank=1,
                                   upload_to=course.models.get_uploadto,
                                   verbose_name='预览图')),
                ('require_course',
                 models.ForeignKey(blank=1,
                                   null=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course',
                                   verbose_name='前置课程')),
            ],
            options={
                'verbose_name': '课程信息',
                'verbose_name_plural': '课程表',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Tree',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='课程树名称')),
                ('describe', models.TextField(verbose_name='课程树描述')),
            ],
            options={
                'verbose_name': '课程天赋',
                'verbose_name_plural': '课程天赋表',
            },
        ),
        migrations.CreateModel(
            name='ProblemSet',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('describe', models.TextField(verbose_name='问题描述')),
                ('answer',
                 models.IntegerField(choices=[(0, 'A'), (1, 'B'), (2, 'C'),
                                              (3, 'D')],
                                     verbose_name='问题答案')),
                ('course',
                 models.ForeignKey(blank=1,
                                   null=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course',
                                   verbose_name='哪个课程的习题')),
                ('user',
                 models.ManyToManyField(blank=1,
                                        to='user.User',
                                        verbose_name='完成习题的用户')),
            ],
            options={
                'verbose_name': '习题集',
                'verbose_name_plural': '习题表',
            },
        ),
        migrations.CreateModel(
            name='CourseVideo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('index', models.IntegerField(verbose_name='视频顺序')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course')),
                ('video',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='base.Video')),
            ],
            options={
                'db_table': 'course_video_relationship',
            },
        ),
        migrations.AddField(
            model_name='course',
            name='tree',
            field=models.ForeignKey(
                blank=1,
                null=1,
                on_delete=django.db.models.deletion.CASCADE,
                to='course.Tree',
                verbose_name='课程天赋树表'),
        ),
        migrations.AddField(
            model_name='course',
            name='user',
            field=models.ManyToManyField(blank=1,
                                         to='user.User',
                                         verbose_name='完成课程的用户'),
        ),
        migrations.AddField(
            model_name='course',
            name='video',
            field=models.ManyToManyField(blank=1,
                                         through='course.CourseVideo',
                                         to='base.Video',
                                         verbose_name='包含视频'),
        ),
    ]