Beispiel #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('curriculum', '0018_auto_20201001_1918'),
    ]

    operations = [
        migrations.AddField(
            model_name='subject',
            name='image',
            field=models.ImageField(
                blank=True,
                upload_to=curriculum.models.save_subject_image,
                verbose_name='Subject Image'),
        ),
        migrations.AddField(
            model_name='subject',
            name='subject_id',
            field=models.CharField(blank=True, max_length=100),
        ),
        migrations.AlterField(
            model_name='subject',
            name='name',
            field=models.CharField(max_length=100),
        ),
    ]
Beispiel #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Standard',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('slug', models.SlugField(blank=True, null=True)),
                ('description', models.TextField(blank=True, max_length=500)),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject_id', models.CharField(max_length=100, unique=True)),
                ('name', models.CharField(max_length=100)),
                ('slug', models.SlugField(blank=True, null=True)),
                ('image', models.ImageField(blank=True, upload_to=curriculum.models.save_subject_image, verbose_name='Subject Image')),
                ('description', models.TextField(blank=True, max_length=500)),
                ('standard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subjects', to='curriculum.standard')),
            ],
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lesson_id', models.CharField(max_length=100, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('name', models.CharField(max_length=250)),
                ('position', models.PositiveSmallIntegerField(verbose_name='Chapter no.')),
                ('slug', models.SlugField(blank=True, null=True)),
                ('video', models.FileField(blank=True, null=True, upload_to=curriculum.models.save_lesson_files, verbose_name='Video')),
                ('ppt', models.FileField(blank=True, upload_to=curriculum.models.save_lesson_files, verbose_name='Presentations')),
                ('Notes', models.FileField(blank=True, upload_to=curriculum.models.save_lesson_files, verbose_name='Notes')),
                ('Standard', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='curriculum.standard')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lessons', to='curriculum.subject')),
            ],
            options={
                'ordering': ['position'],
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('curriculum', '0021_subject_description'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='lesson',
            options={'ordering': ['position']},
        ),
        migrations.AddField(
            model_name='lesson',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='lesson',
            name='lesson_id',
            field=models.CharField(default='0000', max_length=100, unique=True),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='Notes',
            field=models.FileField(blank=True, upload_to=curriculum.models.save_lesson_files, verbose_name='Notes'),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='image',
            field=models.ImageField(blank=True, upload_to=curriculum.models.save_lesson_files, verbose_name='Images'),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='position',
            field=models.PositiveSmallIntegerField(verbose_name='Chapter no.'),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='ppt',
            field=models.FileField(blank=True, upload_to=curriculum.models.save_lesson_files, verbose_name='Presentations'),
        ),
        migrations.AlterField(
            model_name='lesson',
            name='video',
            field=models.FileField(blank=True, upload_to=curriculum.models.save_lesson_files, verbose_name='Video'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('position', models.PositiveSmallIntegerField()),
                ('slug', models.SlugField()),
                ('image',
                 models.ImageField(blank=True,
                                   upload_to='images/',
                                   verbose_name='Images')),
                ('video',
                 models.FileField(blank=True,
                                  upload_to='images/',
                                  verbose_name='Video')),
                ('ppt',
                 models.FileField(blank=True,
                                  upload_to='images/',
                                  verbose_name='Presentations')),
                ('Notes',
                 models.FileField(blank=True,
                                  upload_to='images/',
                                  verbose_name='Notes')),
            ],
        ),
        migrations.CreateModel(
            name='Standard',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('slug', models.SlugField()),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('slug', models.SlugField()),
                ('lesson',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='curriculum.lesson')),
                ('standard',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='curriculum.standard')),
            ],
        ),
    ]