Example #1
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'],
            },
        ),
    ]
Example #2
0
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0002_remove_course_students'),
    ]

    operations = [
        migrations.AddField(
            model_name='course',
            name='cover_image',
            field=models.FileField(
                blank=True,
                upload_to=course.models.get_upload_path,
                validators=[
                    community.validators.validate_image_file_extension
                ]),
        ),
        migrations.AddField(
            model_name='course',
            name='image',
            field=models.FileField(
                blank=True,
                upload_to=course.models.get_upload_path,
                validators=[
                    community.validators.validate_image_file_extension
                ]),
        ),
    ]
Example #3
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AddField(
            model_name='submission',
            name='github_link',
            field=models.URLField(default=None, null=True),
        ),
        migrations.AddField(
            model_name='task',
            name='is_github',
            field=models.BooleanField(
                default=False,
                verbose_name=
                'If you want the participant to provide a GitHub link please select this'
            ),
        ),
        migrations.AlterField(
            model_name='submission',
            name='file',
            field=models.FileField(
                default=None,
                null=True,
                upload_to=course.models.upload_location_submission),
        ),
    ]
Example #4
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')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0007_auto_20210714_2033'),
    ]

    operations = [
        migrations.AlterField(
            model_name='submission',
            name='comments',
            field=models.TextField(null=True),
        ),
        migrations.AlterField(
            model_name='submission',
            name='file',
            field=models.FileField(
                blank=True,
                default=None,
                null=True,
                upload_to=course.models.upload_location_submission),
        ),
        migrations.AlterField(
            model_name='submission',
            name='github_link',
            field=models.URLField(blank=True, default=None, null=True),
        ),
    ]
Example #6
0
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0008_auto_20180305_2253'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='classname',
            options={'ordering': ['-date', 'name']},
        ),
        migrations.AlterField(
            model_name='course',
            name='date',
            field=models.DateField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name='course',
            name='handout',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=course.models.Course.content_file_name),
        ),
    ]
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]),
        ),
    ]
Example #8
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),
        ),
    ]
class Migration(migrations.Migration):
    dependencies = [
        ('course', '0003_auto_20200323_2224'),
    ]

    operations = [
        migrations.AddField(
            model_name='course',
            name='attach',
            field=models.FileField(blank=True, upload_to=course.models.user_directory_path),
        ),
        migrations.AddField(
            model_name='course',
            name='video',
            field=models.FileField(blank=True, upload_to='videos/'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0002_auto_20190803_0938'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='category',
            options={'verbose_name': '课程种类表', 'verbose_name_plural': '课程种类表'},
        ),
        migrations.AlterModelOptions(
            name='course',
            options={'verbose_name': '课程表', 'verbose_name_plural': '课程表'},
        ),
        migrations.AlterField(
            model_name='course',
            name='createDatetime',
            field=models.DateTimeField(blank=True, default=datetime.datetime(2019, 8, 3, 17, 0, 51, 393018), verbose_name='创建时间'),
        ),
        migrations.AlterField(
            model_name='course',
            name='fileName',
            field=models.FileField(upload_to=course.models.save_file, verbose_name='文件名称'),
        ),
        migrations.AlterField(
            model_name='course',
            name='imgName',
            field=models.ImageField(upload_to=course.models.save_img, verbose_name='课程图片'),
        ),
        migrations.AlterField(
            model_name='course',
            name='price',
            field=models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='售价'),
        ),
        migrations.AlterField(
            model_name='course',
            name='status',
            field=models.PositiveSmallIntegerField(blank=True, choices=[(0, '收费'), (1, '免费')], default=0, verbose_name='状态'),
        ),
        migrations.AlterField(
            model_name='course',
            name='summary',
            field=models.CharField(blank=True, default='', max_length=1000, verbose_name='课程介绍'),
        ),
        migrations.AlterField(
            model_name='course',
            name='userBuyer',
            field=models.ManyToManyField(blank=True, related_name='userBuyer', to='user.User', verbose_name='购买用户'),
        ),
        migrations.AlterField(
            model_name='course',
            name='userShoppingcart',
            field=models.ManyToManyField(blank=True, related_name='userShoppingcart_set', to='user.User', verbose_name='加入购物车用户'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0012_auto_20191204_0048'),
    ]

    operations = [
        migrations.AlterField(
            model_name='content',
            name='file',
            field=models.FileField(upload_to=course.models.gen_pic_path),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0017_delete_contents'),
    ]

    operations = [
        migrations.AlterField(
            model_name='content',
            name='file',
            field=models.FileField(upload_to=course.models.contents_file_path),
        ),
    ]
Example #13
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='lesson',
            name='audio',
            field=models.FileField(default=None, upload_to=course.models.scramble_uploaded_filename, verbose_name='Uploaded Audio'),
        ),
    ]
Example #14
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='coursefile',
            name='file',
            field=models.FileField(
                upload_to=course.models.course_directory_path),
        ),
    ]
Example #15
0
class Migration(migrations.Migration):

    dependencies = [
        ('course', '0002_lesson'),
    ]

    operations = [
        migrations.AlterField(
            model_name='lesson',
            name='video',
            field=models.FileField(
                blank=True, upload_to=course.models.user_directory_path),
        ),
    ]
Example #16
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', ),
            },
        ),
    ]
Example #17
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.AddField(
            model_name='course',
            name='outline',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=course.models.get_course_outline_file),
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='course',
            name='image',
            field=models.FileField(
                blank=True,
                upload_to=course.models.get_upload_path,
                validators=[
                    community.validators.validate_image_file_extension
                ]),
        ),
    ]
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'),
        ),
    ]
Example #20
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'],
            },
        ),
    ]
Example #21
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')),
            ],
        ),
    ]
Example #22
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'),
        ),
    ]
Example #23
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')),
            ],
        ),
    ]
Example #24
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Level',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('level_value', models.CharField(max_length=255)),
                ('level_description', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('lesson_name', models.CharField(max_length=255)),
                ('slug', models.SlugField(max_length=500, unique=True)),
                ('lft', models.PositiveIntegerField(editable=False)),
                ('rght', models.PositiveIntegerField(editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(editable=False)),
                ('parent',
                 mptt.fields.TreeForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='children',
                     to='course.lesson')),
            ],
            options={
                'abstract': False,
            },
        ),
        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=255)),
                ('course_description', models.TextField()),
                ('course_price', models.IntegerField()),
                ('course_image',
                 models.FileField(upload_to=course.models.upload_product_img)),
                ('is_feachered', models.BooleanField(default=False)),
                ('publish_date', models.DateField()),
                ('slug', models.SlugField(max_length=500)),
                ('lessons',
                 mptt.fields.TreeManyToManyField(related_name='courses',
                                                 to='course.Lesson')),
                ('level',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='course.level')),
            ],
        ),
    ]
Example #25
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')),
            ],
        ),
    ]
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')),
            ],
        ),
    ]
Example #27
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')]),
        ),
    ]
Example #28
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',
            },
        ),
    ]
Example #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)),
            ],
        ),
    ]
Example #30
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')),
            ],
        ),
    ]