class Migration(migrations.Migration):

    dependencies = [
        ('courses', '0014_course_secondary'),
    ]

    operations = [
        migrations.AddField(
            model_name='course',
            name='image',
            field=models.ImageField(blank=True,
                                    height_field='image_height',
                                    null=True,
                                    upload_to=courses.models.handle_upload,
                                    width_field='image_width'),
        ),
        migrations.AddField(
            model_name='course',
            name='image_height',
            field=models.IntegerField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='course',
            name='image_width',
            field=models.IntegerField(blank=True, null=True),
        ),
    ]
Exemple #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('course_id', models.CharField(max_length=16, primary_key=True, serialize=False)),
                ('course_name', models.CharField(max_length=64)),
                ('credits', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Requirement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('degree_type', models.CharField(max_length=6)),
                ('major_name', models.CharField(max_length=64)),
                ('course_rgx', models.CharField(max_length=128)),
                ('credits', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('student_id', models.CharField(max_length=9, primary_key=True, serialize=False, validators=[courses.models.validate_student_id])),
                ('first_name', models.CharField(max_length=32)),
                ('last_name', models.CharField(max_length=32)),
                ('degree_type', models.CharField(max_length=6)),
                ('major_name', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='Taken',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('semester', models.CharField(max_length=3, validators=[courses.models.validate_semester])),
                ('grade', models.CharField(choices=[('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D'), ('F', 'F/Fail'), ('P', 'Pass')], max_length=1)),
                ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='courses.Course')),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Student')),
            ],
        ),
        migrations.CreateModel(
            name='Prereq',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('coreq', models.BooleanField()),
                ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='courses.Course')),
                ('prereq_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='prereq_course', to='courses.Course')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('courses', '0006_auto_20180817_1112'),
    ]

    operations = [
        migrations.AddField(
            model_name='exam',
            name='status',
            field=models.IntegerField(blank=True,
                                      choices=[(0, 'Não Iniciada'),
                                               (1, 'Em Andamento'),
                                               (2, 'Finalizada')],
                                      default=0),
        ),
        migrations.AlterField(
            model_name='document',
            name='file',
            field=models.FileField(blank=True,
                                   null=True,
                                   upload_to=courses.models.upload_to_dir,
                                   validators=[
                                       courses.validators.FileValidator(
                                           allowed_extensions=('pdf', ),
                                           allowed_mimetypes='application/pdf',
                                           max_size=104857600)
                                   ]),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('cid',
                 models.CharField(max_length=10,
                                  unique=True,
                                  verbose_name='Course ID')),
                ('name', models.CharField(max_length=254)),
                ('semester',
                 models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4),
                                              (5, 5), (6, 6), (7, 7), (8, 8)],
                                     default=1)),
                ('instructor',
                 models.ForeignKey(on_delete=models.SET(
                     courses.models.get_sentinel_user),
                                   to='users.UserProfileFaculty')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('courses', '0016_course_cover'),
    ]

    operations = [
        migrations.AddField(
            model_name='courseenrollment',
            name='_grade',
            field=models.IntegerField(db_column='grade', null=True),
        ),
        migrations.AlterField(
            model_name='course',
            name='cover',
            field=models.ImageField(default='courses/default.png', upload_to=courses.models.course_cover_path, validators=[courses.models.validate_image_size]),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('courses', '0011_auto_20180821_0034'),
    ]

    operations = [
        migrations.CreateModel(
            name='WatchedVideos',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('times', models.IntegerField(blank=True, default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='+',
                                   to=settings.AUTH_USER_MODEL)),
                ('video',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='watched',
                                   to='courses.Video')),
            ],
        ),
        migrations.AlterField(
            model_name='document',
            name='file',
            field=models.FileField(blank=True,
                                   null=True,
                                   upload_to=courses.models.upload_to_dir,
                                   validators=[
                                       courses.validators.FileValidator(
                                           allowed_extensions='pdf',
                                           allowed_mimetypes='application/pdf',
                                           max_size=104857600)
                                   ]),
        ),
    ]
Exemple #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CourseInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(max_length=200, upload_to='course/', verbose_name='课程封面')),
                ('name', models.CharField(max_length=20, verbose_name='课程名称')),
                ('study_time', models.IntegerField(default=0, verbose_name='学习时长')),
                ('study_num', models.IntegerField(default=0, verbose_name='学习人数')),
                ('level', models.CharField(choices=[('gj', '高级'), ('zj', '中级'), ('cj', '初级')], default='cj', max_length=20, verbose_name='课程难度')),
                ('love_num', models.IntegerField(default=0, verbose_name='收藏数')),
                ('click_num', models.IntegerField(default=0, verbose_name='点击数')),
                ('desc', models.CharField(max_length=200, verbose_name='简介')),
                ('detail', models.TextField(verbose_name='课程详情')),
                ('category', models.CharField(choices=[('qd', '前端开发'), ('hd', '后端开发')], max_length=20, verbose_name='课程类别')),
                ('course_notice', models.CharField(max_length=200, verbose_name='课程公告')),
                ('course_need', models.CharField(max_length=100, verbose_name='课程须知')),
                ('course_tell', models.CharField(max_length=100, verbose_name='老师教导')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('orginfo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.OrgInfo', verbose_name='所属机构')),
                ('teacherinfo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orgs.TeacherInfo', verbose_name='所属讲师')),
            ],
            options={
                'verbose_name': '课程信息',
                'verbose_name_plural': '课程信息',
            },
        ),
        migrations.CreateModel(
            name='LessonInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='章节名称')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('courseInfo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.CourseInfo', verbose_name='所属课程')),
            ],
            options={
                'verbose_name': '课程信息',
                'verbose_name_plural': '课程信息',
            },
        ),
        migrations.CreateModel(
            name='SourceInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='资源名称')),
                ('down_load', models.FileField(max_length=200, upload_to='source/', verbose_name='下载路径')),
                ('所属课程', models.FileField(upload_to='', verbose_name=courses.models.CourseInfo)),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '资源信息',
                'verbose_name_plural': '资源信息',
            },
        ),
        migrations.CreateModel(
            name='VideoInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='视频名称')),
                ('study_time', models.IntegerField(default=0, verbose_name='视频时长')),
                ('url', models.URLField(default='http://www.atguigu.com', verbose_name='视频链接')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('lessoninfo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.LessonInfo', verbose_name='所属章节')),
            ],
            options={
                'verbose_name': '视频信息',
                'verbose_name_plural': '视频信息',
            },
        ),
    ]
Exemple #8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Chapter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('chapter_order', models.IntegerField(default=0, verbose_name='章节序号')),
                ('chapter_title', models.CharField(max_length=128, verbose_name='章节标题')),
                ('chapter_desc', models.CharField(max_length=1024, verbose_name='章节介绍')),
                ('add_time', models.DateField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
        ),
        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='课程名')),
                ('desc', models.CharField(max_length=300, verbose_name='课程描述')),
                ('detail', models.TextField(verbose_name='课程详情')),
                ('degree', models.CharField(choices=[('cj', '初级'), ('zj', '中级'), ('gj', '高级')], max_length=2, verbose_name='难度')),
                ('score', models.IntegerField(default=0, verbose_name='课程评分')),
                ('total_duration_study', models.IntegerField(default=0, verbose_name='学习时长(分钟)')),
                ('students_nums', models.IntegerField(default=0, verbose_name='学习人数')),
                ('fav_nums', models.IntegerField(default=0, verbose_name='收藏人数')),
                ('image', models.ImageField(upload_to='courses/%Y/%m', verbose_name='课程封面')),
                ('click_nums', models.IntegerField(default=0, verbose_name='点击数')),
                ('category', models.CharField(default='理论知识', max_length=20, verbose_name='课程类别')),
                ('tag', models.CharField(default='', max_length=10, verbose_name='课程标签')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('course_org', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='orgnization.CourseOrg', verbose_name='课程机构')),
                ('teacher', models.ManyToManyField(blank=True, null=True, to='orgnization.Teacher', verbose_name='授课教师')),
            ],
            options={
                'verbose_name': '课程',
                'verbose_name_plural': '课程',
            },
        ),
        migrations.CreateModel(
            name='CourseResource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='名称')),
                ('download', models.FileField(upload_to='course/resource/%Y/%m', verbose_name='资源文件')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Course', verbose_name='课程')),
            ],
            options={
                'verbose_name': '课程资源',
                'verbose_name_plural': '课程资源',
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lesson_order', models.IntegerField(default=0, verbose_name='小节序号')),
                ('lesson_name', models.CharField(max_length=128, verbose_name='小节标题')),
                ('lesson_time_duration', models.CharField(max_length=10, verbose_name='视频时长')),
                ('add_time', models.DateField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('chapter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Chapter', verbose_name='小节')),
            ],
            options={
                'verbose_name': '章节',
                'verbose_name_plural': '章节',
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='视频名')),
                ('video_source', models.FileField(upload_to=courses.models.Video.upload_to)),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('lesson', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Lesson', verbose_name='章节')),
            ],
            options={
                'verbose_name': '视频',
                'verbose_name_plural': '视频',
            },
        ),
        migrations.AddField(
            model_name='chapter',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Course', verbose_name='章节'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Contest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('title', models.TextField()),
                ('statements', models.FileField(blank=True, upload_to=courses.models.get_statements_file_path)),
                ('show_statements', models.BooleanField(default=False)),
                ('duration', models.IntegerField(default=0)),
                ('coefficient', models.FloatField(default=1.0)),
                ('is_olymp', models.BooleanField(default=False)),
                ('judge', models.CharField(choices=[('EJ', 'Ejudge'), ('CF', 'Codeforces'), ('IN', 'Informatics')], default='EJ', max_length=2)),
                ('contest_id', models.IntegerField()),
                ('external_group_id', models.TextField(blank=True)),
                ('other_link', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='ContestLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('file', models.FileField(blank=True, upload_to=courses.models.get_contest_file_path)),
                ('link', models.TextField(blank=True)),
                ('new_tab', models.BooleanField(default=False)),
                ('priority', models.IntegerField(default=0)),
                ('contest', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='courses.Contest')),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.TextField(unique=True)),
                ('title', models.TextField(blank=True)),
                ('subtitle', models.TextField(blank=True)),
                ('template', models.TextField(default='course.html')),
                ('ejudge_url', models.TextField(blank=True)),
                ('url', models.TextField(blank=True)),
                ('name_in_main', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='CourseLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('file', models.FileField(blank=True, upload_to=courses.models.get_course_file_path)),
                ('link', models.TextField(blank=True)),
                ('hidden', models.BooleanField(default=False)),
                ('new_tab', models.BooleanField(default=False)),
                ('priority', models.IntegerField(default=0)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='courses.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Main',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.TextField(blank=True)),
                ('subtitle', models.TextField(blank=True)),
                ('courses', models.ManyToManyField(to='courses.Course')),
            ],
        ),
        migrations.CreateModel(
            name='MainLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('file', models.FileField(blank=True, upload_to=courses.models.get_main_file_path)),
                ('link', models.TextField(blank=True)),
                ('hidden', models.BooleanField(default=False)),
                ('new_tab', models.BooleanField(default=False)),
                ('priority', models.IntegerField(default=0)),
                ('main', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='courses.Main')),
            ],
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.TextField(unique=True)),
                ('title', models.TextField(blank=True)),
                ('subtitle', models.TextField(blank=True)),
                ('content', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='Participant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField(verbose_name='Surname and name')),
                ('ejudge_id', models.IntegerField(blank=True, null=True)),
                ('informatics_id', models.IntegerField(blank=True, null=True)),
                ('codeforces_handle', models.TextField(blank=True)),
                ('comment', models.TextField(blank=True)),
                ('email', models.TextField(blank=True)),
                ('telegram_id', models.TextField(blank=True)),
                ('vk_id', models.TextField(blank=True)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='participants', to='courses.Course')),
            ],
        ),
        migrations.CreateModel(
            name='ParticipantsGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
                ('short_name', models.TextField()),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='groups', to='courses.Course')),
            ],
        ),
        migrations.CreateModel(
            name='Standings',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.TextField()),
                ('olymp', models.BooleanField(default=False)),
                ('enable_marks', models.BooleanField(default=False)),
                ('js_for_contest_mark', models.TextField(blank=True)),
                ('js_for_total_mark', models.TextField(blank=True)),
                ('js', models.TextField(blank=True)),
                ('contests', models.ManyToManyField(related_name='standings', to='courses.Contest')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='standings', to='courses.Course')),
            ],
            options={
                'verbose_name_plural': 'Standings',
            },
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
                ('description', models.TextField(blank=True)),
                ('photo', models.FileField(blank=True, upload_to=courses.models.get_photo_path)),
                ('vk_id', models.TextField(blank=True)),
                ('telegram_id', models.TextField(blank=True)),
            ],
        ),
        migrations.AddField(
            model_name='participant',
            name='group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='participants', to='courses.ParticipantsGroup'),
        ),
        migrations.AddField(
            model_name='course',
            name='teachers',
            field=models.ManyToManyField(blank=True, related_name='courses', to='courses.Teacher'),
        ),
        migrations.AddField(
            model_name='contest',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contests', to='courses.Course'),
        ),
    ]
Exemple #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    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=40)),
                ('started',
                 models.PositiveIntegerField(
                     default=2020,
                     validators=[
                         django.core.validators.MinValueValidator(1970),
                         courses.models.max_value_current_year
                     ])),
            ],
            options={
                'ordering': ('name', ),
            },
        ),
        migrations.CreateModel(
            name='CourseGrade',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('grade',
                 models.CharField(choices=[('A', 'Excellent'), ('B', 'Good'),
                                           ('C', 'Fair'), ('D', 'Poor')],
                                  max_length=1)),
            ],
            options={
                'ordering': ('student', 'course', 'grade'),
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start_time', models.DateTimeField(blank=True, null=True)),
                ('duration', models.IntegerField(blank=True, null=True)),
                ('location',
                 models.CharField(blank=True, max_length=80, null=True)),
            ],
            options={
                'ordering': ('course', '-start_time'),
            },
        ),
        migrations.CreateModel(
            name='LessonGrade',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('grade',
                 models.CharField(choices=[('A', 'Excellent'), ('B', 'Good'),
                                           ('C', 'Fair'), ('D', 'Poor')],
                                  max_length=1)),
                ('lesson',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.Lesson')),
            ],
            options={
                'ordering': ('student', 'lesson', 'grade'),
            },
        ),
    ]
Exemple #11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Courses',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('name', models.CharField(max_length=100,
                                          verbose_name='name')),
                ('slug', models.CharField(max_length=100,
                                          verbose_name='slug')),
                ('short_description',
                 models.TextField(max_length=300,
                                  verbose_name='short description')),
                ('description', models.TextField(verbose_name='description')),
                ('course_fee', models.FloatField(verbose_name='course fee')),
                ('image',
                 models.ImageField(upload_to=courses.models.course_image_path,
                                   verbose_name='image')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='is active')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='created at')),
            ],
            options={
                'verbose_name': 'course',
                'verbose_name_plural': 'courses',
            },
        ),
        migrations.CreateModel(
            name='Enrolled',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('payment_status',
                 models.CharField(choices=[('unpaid', 'Unpaid'),
                                           ('partly', 'Part Payment'),
                                           ('paid', 'Fully Paid')],
                                  max_length=50)),
                ('date_enrolled',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='created at')),
            ],
        ),
        migrations.CreateModel(
            name='Modules',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('name', models.CharField(max_length=100,
                                          verbose_name='name')),
                ('description', models.TextField(verbose_name='description')),
                ('order', models.IntegerField(verbose_name='order')),
                ('date_created',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date created')),
            ],
            options={
                'verbose_name': 'module',
                'verbose_name_plural': 'modules',
            },
        ),
        migrations.CreateModel(
            name='UserModules',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('date_activated',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date activated')),
                ('expires', models.DateTimeField(verbose_name='date expires')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='user_modules',
                                   to='courses.Courses')),
                ('module',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.Modules')),
            ],
        ),
    ]
Exemple #12
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=256)),
                ('participants', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('topic', models.CharField(max_length=256)),
                ('document', models.FileField(upload_to=courses.models.get_upload_path_doc)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.course')),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('lecture', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.lecture')),
            ],
        ),
        migrations.CreateModel(
            name='Solution',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.task')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Mark',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('result', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10)])),
                ('solution', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='courses.solution')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField()),
                ('mark', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.mark')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Exemple #13
0
class Migration(migrations.Migration):

    dependencies = [
        ('courses', '0008_contest_contest_type'),
    ]

    operations = [
        migrations.CreateModel(
            name='BlitzProblem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('problem_id', models.TextField()),
                ('description', models.TextField(blank=True)),
                ('statements',
                 models.FileField(
                     upload_to=courses.models.get_blitz_statements_file_path)),
            ],
        ),
        migrations.RemoveField(
            model_name='contest',
            name='is_olymp',
        ),
        migrations.AddField(
            model_name='standings',
            name='contest_type',
            field=models.CharField(choices=[('AC', 'Acm'), ('OL', 'Olympiad'),
                                            ('BS', 'Battleship'),
                                            ('BT', 'Blitz')],
                                   default='AC',
                                   max_length=2),
        ),
        migrations.RunPython(change_olymp_to_type, revert_type_to_olymp),
        migrations.CreateModel(
            name='BlitzProblemStart',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('participant_id', models.IntegerField()),
                ('time', models.DateTimeField(auto_now_add=True)),
                ('bid', models.IntegerField(default=0)),
                ('problem',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='starts',
                                   to='courses.BlitzProblem')),
            ],
        ),
        migrations.AddField(
            model_name='blitzproblem',
            name='contest',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='blitz_problems',
                to='courses.Contest'),
        ),
    ]
Exemple #14
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=300, verbose_name='Title')),
                ('slug', models.SlugField()),
                ('places', models.IntegerField(verbose_name='Places to course')),
                ('description', models.TextField(verbose_name='About the course')),
                ('price', models.IntegerField(verbose_name='Price')),
                ('is_active', models.BooleanField(verbose_name='Is course active?')),
                ('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date added')),
            ],
            options={
                'ordering': ['-date_added'],
                'verbose_name_plural': 'Courses',
                'verbose_name': 'Course',
            },
        ),
        migrations.CreateModel(
            name='CourseReview',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=50, verbose_name='First name')),
                ('last_name', models.CharField(max_length=60, verbose_name='Last name')),
                ('avatar', models.FileField(blank=True, null=True, upload_to=courses.models.upload_path, verbose_name='Avatar')),
                ('link_to_fb', models.CharField(blank=True, max_length=200, null=True, verbose_name='Link to Facebook')),
                ('link_to_inst', models.CharField(blank=True, max_length=200, null=True, verbose_name='Link to Instagram')),
                ('link_to_linkedin', models.CharField(blank=True, max_length=200, null=True, verbose_name='Link to LinkedIn')),
                ('review', models.TextField(verbose_name='Review')),
                ('video', models.FileField(blank=True, null=True, upload_to=courses.models.upload_path, verbose_name='Video review')),
                ('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date added')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Course', verbose_name='Course')),
            ],
            options={
                'ordering': ['-date_added'],
                'verbose_name_plural': 'Courses reviews',
                'verbose_name': 'Course review',
            },
        ),
        migrations.CreateModel(
            name='CourseTypes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('permission', models.CharField(choices=[('F_S', 'Fast start'), ('A_I', 'All-inclusive'), ('P', 'Premium')], default='F_S', max_length=50, verbose_name='Permission')),
                ('title', models.CharField(max_length=60, verbose_name='Title')),
                ('is_active', models.BooleanField(verbose_name='Is course type active?')),
                ('description', models.TextField(verbose_name='Description')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Course', verbose_name='Course')),
            ],
            options={
                'verbose_name_plural': 'Course types',
                'verbose_name': 'Course type',
            },
        ),
        migrations.CreateModel(
            name='Discount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='Title')),
                ('slug', models.SlugField()),
                ('percents', models.IntegerField(verbose_name='Percents')),
                ('from_date', models.DateField(verbose_name='From')),
                ('till_date', models.DateField(verbose_name='Till')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Author')),
            ],
            options={
                'verbose_name_plural': 'Discounts',
                'verbose_name': 'Discount',
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=50, verbose_name='First name')),
                ('last_name', models.CharField(max_length=60, verbose_name='Last name')),
                ('email', models.EmailField(max_length=100, unique=True, verbose_name='Email')),
                ('phone', models.CharField(max_length=20, unique=True, verbose_name='Phone')),
                ('skype', models.CharField(blank=True, max_length=40, null=True, unique=True, verbose_name='Skype')),
                ('date_added', models.DateTimeField(auto_now_add=True, verbose_name='Date added')),
                ('courses', models.ManyToManyField(to='courses.Course', verbose_name='Courses')),
            ],
            options={
                'ordering': ['-date_added'],
                'verbose_name_plural': 'Students',
                'verbose_name': 'Student',
            },
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=50, verbose_name='First name')),
                ('last_name', models.CharField(max_length=60, verbose_name='Last name')),
                ('email', models.EmailField(max_length=100, verbose_name='Email')),
                ('avatar', models.FileField(blank=True, null=True, upload_to=courses.models.upload_path, verbose_name='Avatar')),
                ('age', models.DateField(verbose_name='Age')),
                ('description', models.TextField(blank=True, null=True, verbose_name='About teacher')),
            ],
            options={
                'verbose_name_plural': 'Teachers',
                'verbose_name': 'Teacher',
            },
        ),
        migrations.AddField(
            model_name='course',
            name='discount',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='courses.Discount', verbose_name='Discount'),
        ),
        migrations.AddField(
            model_name='course',
            name='teachers',
            field=models.ManyToManyField(to='courses.Teacher', verbose_name='Teachers'),
        ),
    ]