class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='ChannelMetadataCache',
            fields=[
                ('id',
                 kolibri.content.models.UUIDField(primary_key=True,
                                                  serialize=False)),
                ('name', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=400)),
                ('author', models.CharField(blank=True, max_length=400)),
                ('version', models.IntegerField(default=0)),
                ('thumbnail', models.TextField(blank=True)),
                ('root_pk', kolibri.content.models.UUIDField()),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
Exemple #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ChannelMetadata',
            fields=[
                ('id', kolibri.content.models.UUIDField(max_length=32, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=400)),
                ('author', models.CharField(blank=True, max_length=400)),
                ('version', models.IntegerField(default=0)),
                ('thumbnail', models.TextField(blank=True)),
                ('root_pk', kolibri.content.models.UUIDField(max_length=32)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ChannelMetadataCache',
            fields=[
                ('id', kolibri.content.models.UUIDField(max_length=32, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=400)),
                ('author', models.CharField(blank=True, max_length=400)),
                ('version', models.IntegerField(default=0)),
                ('thumbnail', models.TextField(blank=True)),
                ('root_pk', kolibri.content.models.UUIDField(max_length=32)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ContentNode',
            fields=[
                ('id', kolibri.content.models.UUIDField(max_length=32, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=200)),
                ('content_id', kolibri.content.models.UUIDField(max_length=32)),
                ('description', models.CharField(blank=True, max_length=400, null=True)),
                ('sort_order', models.FloatField(blank=True, null=True)),
                ('license_owner', models.CharField(blank=True, max_length=200)),
                ('author', models.CharField(blank=True, max_length=200)),
                ('kind', models.CharField(blank=True, choices=[(b'topic', 'Topic'), (b'video', 'Video'), (b'audio', 'Audio'), (b'exercise', 'Exercise'), (b'document', 'Document'), (b'image', 'Image')], max_length=200)),
                ('available', models.BooleanField(default=False)),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('has_prerequisite', models.ManyToManyField(blank=True, related_name='prerequisite_for', to='content.ContentNode')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ContentTag',
            fields=[
                ('id', kolibri.content.models.UUIDField(max_length=32, primary_key=True, serialize=False)),
                ('tag_name', models.CharField(blank=True, max_length=30)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', kolibri.content.models.UUIDField(max_length=32, primary_key=True, serialize=False)),
                ('checksum', models.CharField(blank=True, max_length=400)),
                ('extension', models.CharField(blank=True, choices=[(b'mp4', 'mp4'), (b'vtt', 'vtt'), (b'srt', 'srt'), (b'mp3', 'mp3'), (b'pdf', 'pdf')], max_length=40)),
                ('available', models.BooleanField(default=False)),
                ('file_size', models.IntegerField(blank=True, null=True)),
                ('preset', models.CharField(blank=True, choices=[(b'high_res_video', 'High resolution video'), (b'low_res_video', 'Low resolution video'), (b'vector_video', 'Vertor video'), (b'thumbnail', 'Thumbnail'), (b'thumbnail', 'Thumbnail'), (b'caption', 'Caption')], max_length=150)),
                ('supplementary', models.BooleanField(default=False)),
                ('thumbnail', models.BooleanField(default=False)),
                ('priority', models.IntegerField(blank=True, null=True)),
                ('contentnode', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='files', to='content.ContentNode')),
            ],
            options={
                'ordering': ['priority'],
            },
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lang_code', models.CharField(db_index=True, max_length=2)),
                ('lang_subcode', models.CharField(db_index=True, max_length=2)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='License',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('license_name', models.CharField(max_length=50)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='file',
            name='lang',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='content.Language'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='license',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='content.License'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='parent',
            field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='content.ContentNode'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='related',
            field=models.ManyToManyField(blank=True, related_name='_contentnode_related_+', to='content.ContentNode'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='tags',
            field=models.ManyToManyField(blank=True, related_name='tagged_content', to='content.ContentTag'),
        ),
    ]
Exemple #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('kolibriauth', '0001_initial_redone'),
    ]

    operations = [
        migrations.CreateModel(
            name='ContentRatingLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content_id',
                 kolibri.content.models.UUIDField(db_index=True)),
                ('channel_id', kolibri.content.models.UUIDField()),
                ('quality',
                 models.IntegerField(
                     blank=True,
                     null=True,
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(5)
                     ])),
                ('ease',
                 models.IntegerField(
                     blank=True,
                     null=True,
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(5)
                     ])),
                ('learning',
                 models.IntegerField(
                     blank=True,
                     null=True,
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(5)
                     ])),
                ('feedback', models.TextField(blank=True)),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ContentSessionLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content_id',
                 kolibri.content.models.UUIDField(db_index=True)),
                ('channel_id', kolibri.content.models.UUIDField()),
                ('start_timestamp', models.DateTimeField()),
                ('end_timestamp', models.DateTimeField(blank=True, null=True)),
                ('time_spent',
                 models.FloatField(
                     default=0.0,
                     help_text='(in seconds)',
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('progress',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('kind', models.CharField(max_length=200)),
                ('extra_fields', models.TextField(default='{}')),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ContentSummaryLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content_id',
                 kolibri.content.models.UUIDField(db_index=True)),
                ('channel_id', kolibri.content.models.UUIDField()),
                ('start_timestamp', models.DateTimeField()),
                ('end_timestamp', models.DateTimeField(blank=True, null=True)),
                ('completion_timestamp',
                 models.DateTimeField(blank=True, null=True)),
                ('time_spent',
                 models.FloatField(
                     default=0.0,
                     help_text='(in seconds)',
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('progress',
                 models.FloatField(
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(1)
                     ])),
                ('kind', models.CharField(max_length=200)),
                ('extra_fields', models.TextField(default='{}')),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='UserSessionLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('channels', models.TextField(blank=True)),
                ('start_timestamp', models.DateTimeField(auto_now_add=True)),
                ('completion_timestamp',
                 models.DateTimeField(blank=True, null=True)),
                ('pages', models.TextField(blank=True)),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('exams', '__first__'),
        ('kolibriauth', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='AttemptLog',
            fields=[
                ('id',
                 morango.utils.uuids.UUIDField(editable=False,
                                               primary_key=True,
                                               serialize=False)),
                ('_morango_dirty_bit',
                 models.BooleanField(default=True, editable=False)),
                ('_morango_source_id',
                 models.CharField(editable=False, max_length=96)),
                ('_morango_partition',
                 models.CharField(editable=False, max_length=128)),
                ('item', models.CharField(max_length=200)),
                ('start_timestamp', models.DateTimeField()),
                ('end_timestamp', models.DateTimeField()),
                ('completion_timestamp',
                 models.DateTimeField(blank=True, null=True)),
                ('time_spent',
                 models.FloatField(
                     default=0.0,
                     help_text='(in seconds)',
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('complete', models.BooleanField(default=False)),
                ('correct',
                 models.FloatField(validators=[
                     django.core.validators.MinValueValidator(0),
                     django.core.validators.MaxValueValidator(1)
                 ])),
                ('hinted', models.BooleanField(default=False)),
                ('answer',
                 jsonfield.fields.JSONField(blank=True, default={},
                                            null=True)),
                ('simple_answer', models.CharField(blank=True,
                                                   max_length=200)),
                ('interaction_history',
                 jsonfield.fields.JSONField(blank=True, default=[])),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ContentSessionLog',
            fields=[
                ('id',
                 morango.utils.uuids.UUIDField(editable=False,
                                               primary_key=True,
                                               serialize=False)),
                ('_morango_dirty_bit',
                 models.BooleanField(default=True, editable=False)),
                ('_morango_source_id',
                 models.CharField(editable=False, max_length=96)),
                ('_morango_partition',
                 models.CharField(editable=False, max_length=128)),
                ('content_id',
                 kolibri.content.models.UUIDField(db_index=True)),
                ('channel_id', kolibri.content.models.UUIDField()),
                ('start_timestamp', models.DateTimeField()),
                ('end_timestamp', models.DateTimeField(blank=True, null=True)),
                ('time_spent',
                 models.FloatField(
                     default=0.0,
                     help_text='(in seconds)',
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('progress',
                 models.FloatField(
                     default=0,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('kind', models.CharField(max_length=200)),
                ('extra_fields',
                 jsonfield.fields.JSONField(blank=True, default={})),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ContentSummaryLog',
            fields=[
                ('id',
                 morango.utils.uuids.UUIDField(editable=False,
                                               primary_key=True,
                                               serialize=False)),
                ('_morango_dirty_bit',
                 models.BooleanField(default=True, editable=False)),
                ('_morango_source_id',
                 models.CharField(editable=False, max_length=96)),
                ('_morango_partition',
                 models.CharField(editable=False, max_length=128)),
                ('content_id',
                 kolibri.content.models.UUIDField(db_index=True)),
                ('channel_id', kolibri.content.models.UUIDField()),
                ('start_timestamp', models.DateTimeField()),
                ('end_timestamp', models.DateTimeField(blank=True, null=True)),
                ('completion_timestamp',
                 models.DateTimeField(blank=True, null=True)),
                ('time_spent',
                 models.FloatField(
                     default=0.0,
                     help_text='(in seconds)',
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('progress',
                 models.FloatField(
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(1)
                     ])),
                ('kind', models.CharField(max_length=200)),
                ('extra_fields',
                 jsonfield.fields.JSONField(blank=True, default={})),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ExamAttemptLog',
            fields=[
                ('id',
                 morango.utils.uuids.UUIDField(editable=False,
                                               primary_key=True,
                                               serialize=False)),
                ('_morango_dirty_bit',
                 models.BooleanField(default=True, editable=False)),
                ('_morango_source_id',
                 models.CharField(editable=False, max_length=96)),
                ('_morango_partition',
                 models.CharField(editable=False, max_length=128)),
                ('item', models.CharField(max_length=200)),
                ('start_timestamp', models.DateTimeField()),
                ('end_timestamp', models.DateTimeField()),
                ('completion_timestamp',
                 models.DateTimeField(blank=True, null=True)),
                ('time_spent',
                 models.FloatField(
                     default=0.0,
                     help_text='(in seconds)',
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('complete', models.BooleanField(default=False)),
                ('correct',
                 models.FloatField(validators=[
                     django.core.validators.MinValueValidator(0),
                     django.core.validators.MaxValueValidator(1)
                 ])),
                ('hinted', models.BooleanField(default=False)),
                ('answer',
                 jsonfield.fields.JSONField(blank=True, default={},
                                            null=True)),
                ('simple_answer', models.CharField(blank=True,
                                                   max_length=200)),
                ('interaction_history',
                 jsonfield.fields.JSONField(blank=True, default=[])),
                ('content_id', kolibri.content.models.UUIDField()),
                ('channel_id', kolibri.content.models.UUIDField()),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ExamLog',
            fields=[
                ('id',
                 morango.utils.uuids.UUIDField(editable=False,
                                               primary_key=True,
                                               serialize=False)),
                ('_morango_dirty_bit',
                 models.BooleanField(default=True, editable=False)),
                ('_morango_source_id',
                 models.CharField(editable=False, max_length=96)),
                ('_morango_partition',
                 models.CharField(editable=False, max_length=128)),
                ('closed', models.BooleanField(default=False)),
                ('completion_timestamp',
                 models.DateTimeField(blank=True, null=True)),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('exam',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='examlogs',
                                   to='exams.Exam')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MasteryLog',
            fields=[
                ('id',
                 morango.utils.uuids.UUIDField(editable=False,
                                               primary_key=True,
                                               serialize=False)),
                ('_morango_dirty_bit',
                 models.BooleanField(default=True, editable=False)),
                ('_morango_source_id',
                 models.CharField(editable=False, max_length=96)),
                ('_morango_partition',
                 models.CharField(editable=False, max_length=128)),
                ('mastery_criterion', jsonfield.fields.JSONField(default={})),
                ('start_timestamp', models.DateTimeField()),
                ('end_timestamp', models.DateTimeField(blank=True, null=True)),
                ('completion_timestamp',
                 models.DateTimeField(blank=True, null=True)),
                ('mastery_level',
                 models.IntegerField(validators=[
                     django.core.validators.MinValueValidator(1),
                     django.core.validators.MaxValueValidator(10)
                 ])),
                ('complete', models.BooleanField(default=False)),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('summarylog',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='masterylogs',
                                   to='logger.ContentSummaryLog')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='UserSessionLog',
            fields=[
                ('id',
                 morango.utils.uuids.UUIDField(editable=False,
                                               primary_key=True,
                                               serialize=False)),
                ('_morango_dirty_bit',
                 models.BooleanField(default=True, editable=False)),
                ('_morango_source_id',
                 models.CharField(editable=False, max_length=96)),
                ('_morango_partition',
                 models.CharField(editable=False, max_length=128)),
                ('channels', models.TextField(blank=True)),
                ('start_timestamp', models.DateTimeField(auto_now_add=True)),
                ('last_interaction_timestamp',
                 models.DateTimeField(auto_now=True, null=True)),
                ('pages', models.TextField(blank=True)),
                ('dataset',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityDataset')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='kolibriauth.FacilityUser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='examattemptlog',
            name='examlog',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='attemptlogs',
                to='logger.ExamLog'),
        ),
        migrations.AddField(
            model_name='examattemptlog',
            name='user',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='kolibriauth.FacilityUser'),
        ),
        migrations.AddField(
            model_name='attemptlog',
            name='masterylog',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='attemptlogs',
                to='logger.MasteryLog'),
        ),
        migrations.AddField(
            model_name='attemptlog',
            name='sessionlog',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='attemptlogs',
                to='logger.ContentSessionLog'),
        ),
        migrations.AddField(
            model_name='attemptlog',
            name='user',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='kolibriauth.FacilityUser'),
        ),
    ]
Exemple #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='AssessmentMetaData',
            fields=[
                ('id',
                 kolibri.content.models.UUIDField(primary_key=True,
                                                  serialize=False)),
                ('assessment_item_ids',
                 jsonfield.fields.JSONField(default=[])),
                ('number_of_assessments', models.IntegerField()),
                ('mastery_model', jsonfield.fields.JSONField(default={})),
                ('randomize', models.BooleanField(default=False)),
                ('is_manipulable', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ChannelMetadata',
            fields=[
                ('id',
                 kolibri.content.models.UUIDField(primary_key=True,
                                                  serialize=False)),
                ('name', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=400)),
                ('author', models.CharField(blank=True, max_length=400)),
                ('version', models.IntegerField(default=0)),
                ('thumbnail', models.TextField(blank=True)),
                ('root_pk', kolibri.content.models.UUIDField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ChannelMetadataCache',
            fields=[
                ('id',
                 kolibri.content.models.UUIDField(primary_key=True,
                                                  serialize=False)),
                ('name', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=400)),
                ('author', models.CharField(blank=True, max_length=400)),
                ('version', models.IntegerField(default=0)),
                ('thumbnail', models.TextField(blank=True)),
                ('root_pk', kolibri.content.models.UUIDField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ContentNode',
            fields=[
                ('id',
                 kolibri.content.models.UUIDField(primary_key=True,
                                                  serialize=False)),
                ('title', models.CharField(max_length=200)),
                ('content_id',
                 kolibri.content.models.UUIDField(db_index=True)),
                ('description',
                 models.CharField(blank=True, max_length=400, null=True)),
                ('sort_order', models.FloatField(blank=True, null=True)),
                ('license_owner', models.CharField(blank=True,
                                                   max_length=200)),
                ('author', models.CharField(blank=True, max_length=200)),
                ('kind',
                 models.CharField(blank=True,
                                  choices=[(b'topic', b'Topic'),
                                           (b'video', b'Video'),
                                           (b'audio', b'Audio'),
                                           (b'exercise', b'Exercise'),
                                           (b'document', b'Document'),
                                           (b'html5', b'HTML5 App')],
                                  max_length=200)),
                ('available', models.BooleanField(default=False)),
                ('stemmed_metaphone',
                 models.CharField(blank=True, max_length=1800)),
                ('lft',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('has_prerequisite',
                 models.ManyToManyField(blank=True,
                                        related_name='prerequisite_for',
                                        to='content.ContentNode')),
            ],
            options={
                'ordering': ('sort_order', ),
            },
        ),
        migrations.CreateModel(
            name='ContentTag',
            fields=[
                ('id',
                 kolibri.content.models.UUIDField(primary_key=True,
                                                  serialize=False)),
                ('tag_name', models.CharField(blank=True, max_length=30)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id',
                 kolibri.content.models.UUIDField(primary_key=True,
                                                  serialize=False)),
                ('checksum', models.CharField(blank=True, max_length=400)),
                ('extension',
                 models.CharField(blank=True,
                                  choices=[(b'mp4', b'MP4 Video'),
                                           (b'vtt', b'VTT Subtitle'),
                                           (b'srt', b'SRT Subtitle'),
                                           (b'mp3', b'MP3 Audio'),
                                           (b'wav', b'WAV Audio'),
                                           (b'pdf', b'PDF Document'),
                                           (b'jpg', b'JPG Image'),
                                           (b'jpeg', b'JPEG Image'),
                                           (b'png', b'PNG Image'),
                                           (b'json', b'JSON'),
                                           (b'svg', b'SVG Image'),
                                           (b'perseus', b'Perseus Exercise'),
                                           (b'zip', b'HTML5 Zip')],
                                  max_length=40)),
                ('available', models.BooleanField(default=False)),
                ('file_size', models.IntegerField(blank=True, null=True)),
                ('preset',
                 models.CharField(
                     blank=True,
                     choices=[(b'high_res_video', b'High Resolution'),
                              (b'low_res_video', b'Low Resolution'),
                              (b'vector_video', b'Vectorized'),
                              (b'video_thumbnail', b'Thumbnail'),
                              (b'video_subtitle', b'Subtitle'),
                              (b'audio', b'Audio'),
                              (b'audio_thumbnail', b'Thumbnail'),
                              (b'document', b'Document'),
                              (b'document_thumbnail', b'Thumbnail'),
                              (b'exercise', b'Exercise'),
                              (b'exercise_thumbnail', b'Thumbnail'),
                              (b'exercise_image', b'Exercise Image'),
                              (b'exercise_graphie', b'Exercise Graphie'),
                              (b'channel_thumbnail', b'Channel Thumbnail'),
                              (b'html5_zip', b'HTML5 Zip'),
                              (b'html5_thumbnail', b'HTML5 Thumbnail')],
                     max_length=150)),
                ('supplementary', models.BooleanField(default=False)),
                ('thumbnail', models.BooleanField(default=False)),
                ('priority', models.IntegerField(blank=True, null=True)),
                ('contentnode',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='files',
                                   to='content.ContentNode')),
            ],
            options={
                'ordering': ['priority'],
            },
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id',
                 models.CharField(max_length=7,
                                  primary_key=True,
                                  serialize=False)),
                ('lang_code', models.CharField(db_index=True, max_length=3)),
                ('lang_subcode',
                 models.CharField(blank=True,
                                  db_index=True,
                                  max_length=3,
                                  null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='License',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('license_name', models.CharField(max_length=50)),
                ('license_description',
                 models.CharField(blank=True, max_length=400, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='file',
            name='lang',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='content.Language'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='license',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='content.License'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='parent',
            field=mptt.fields.TreeForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='children',
                to='content.ContentNode'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='related',
            field=models.ManyToManyField(blank=True,
                                         related_name='_contentnode_related_+',
                                         to='content.ContentNode'),
        ),
        migrations.AddField(
            model_name='contentnode',
            name='tags',
            field=models.ManyToManyField(blank=True,
                                         related_name='tagged_content',
                                         to='content.ContentTag'),
        ),
        migrations.AddField(
            model_name='assessmentmetadata',
            name='contentnode',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='assessmentmetadata',
                to='content.ContentNode'),
        ),
    ]
Exemple #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='ChannelMetadata',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('channel_id', models.UUIDField(default=uuid.uuid4,
                                                unique=True)),
                ('name', models.CharField(max_length=200)),
                ('description',
                 models.CharField(blank=True, max_length=400, null=True)),
                ('author',
                 models.CharField(blank=True, max_length=400, null=True)),
                ('theme',
                 models.CharField(blank=True, max_length=400, null=True)),
                ('subscribed', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='ContentCopyTracking',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('referenced_count', models.IntegerField(blank=True,
                                                         null=True)),
                ('content_copy_id',
                 models.CharField(max_length=400, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='ContentMetadata',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content_id',
                 models.UUIDField(default=uuid.uuid4, editable=False)),
                ('title', models.CharField(max_length=200)),
                ('description',
                 models.CharField(blank=True, max_length=400, null=True)),
                ('kind', models.CharField(max_length=50)),
                ('slug', models.CharField(max_length=100)),
                ('total_file_size', models.IntegerField()),
                ('available', models.BooleanField(default=False)),
                ('sort_order', models.FloatField(blank=True, null=True)),
                ('license_owner',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('lft',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level',
                 models.PositiveIntegerField(db_index=True, editable=False)),
            ],
            options={
                'verbose_name': 'Content Metadata',
            },
            managers=[
                ('_default_manager', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='ContentTag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('tag_name',
                 models.CharField(blank=True, max_length=30, null=True)),
                ('tag_type',
                 models.CharField(blank=True, max_length=30, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('checksum',
                 models.CharField(blank=True, max_length=400, null=True)),
                ('extension',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('available', models.BooleanField(default=False)),
                ('file_size', models.IntegerField(blank=True, null=True)),
                ('content_copy',
                 models.FileField(
                     blank=True,
                     max_length=200,
                     storage=kolibri.content.models.ContentCopyStorage(),
                     upload_to=kolibri.content.models.content_copy_name)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Format',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('available', models.BooleanField(default=False)),
                ('format_size', models.IntegerField(blank=True, null=True)),
                ('quality',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('contentmetadata',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='formats',
                                   to='content.ContentMetadata')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='License',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('license_name', models.CharField(max_length=50)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MimeType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('readable_name', models.CharField(max_length=50)),
                ('machine_name', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrerequisiteContentRelationship',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('contentmetadata_1',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='content_prerequisitecontentrelationship_1',
                     to='content.ContentMetadata')),
                ('contentmetadata_2',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='content_prerequisitecontentrelationship_2',
                     to='content.ContentMetadata')),
            ],
        ),
        migrations.CreateModel(
            name='RelatedContentRelationship',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('contentmetadata_1',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='content_relatedcontentrelationship_1',
                     to='content.ContentMetadata')),
                ('contentmetadata_2',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='content_relatedcontentrelationship_2',
                     to='content.ContentMetadata')),
            ],
        ),
        migrations.AddField(
            model_name='format',
            name='mimetype',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='content.MimeType'),
        ),
        migrations.AddField(
            model_name='file',
            name='format',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='files',
                to='content.Format'),
        ),
        migrations.AddField(
            model_name='contentmetadata',
            name='is_related',
            field=models.ManyToManyField(
                blank=True,
                related_name='relate_to',
                through='content.RelatedContentRelationship',
                to='content.ContentMetadata'),
        ),
        migrations.AddField(
            model_name='contentmetadata',
            name='license',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='content.License'),
        ),
        migrations.AddField(
            model_name='contentmetadata',
            name='parent',
            field=mptt.fields.TreeForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='children',
                to='content.ContentMetadata'),
        ),
        migrations.AddField(
            model_name='contentmetadata',
            name='prerequisite',
            field=models.ManyToManyField(
                blank=True,
                related_name='is_prerequisite_of',
                through='content.PrerequisiteContentRelationship',
                to='content.ContentMetadata'),
        ),
        migrations.AddField(
            model_name='contentmetadata',
            name='tags',
            field=models.ManyToManyField(blank=True,
                                         related_name='tagged_content',
                                         to='content.ContentTag'),
        ),
        migrations.AlterUniqueTogether(
            name='relatedcontentrelationship',
            unique_together=set([('contentmetadata_1', 'contentmetadata_2')]),
        ),
        migrations.AlterUniqueTogether(
            name='prerequisitecontentrelationship',
            unique_together=set([('contentmetadata_1', 'contentmetadata_2')]),
        ),
    ]