예제 #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('content_management', '0008_content_duplicatable'),
    ]

    operations = [
        migrations.AlterField(
            model_name='content',
            name='content_file',
            field=models.FileField(
                max_length=300,
                upload_to=content_management.models.Content.set_file_name,
                validators=[
                    content_management.validators.validate_unique_filename,
                    content_management.validators.validate_unique_file
                ],
                verbose_name='File'),
        ),
        migrations.AlterField(
            model_name='content',
            name='filesize',
            field=models.FloatField(null=True),
        ),
        migrations.CreateModel(
            name='LibraryModule',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('module_name', models.CharField(max_length=300)),
                ('module_file', models.FileField(upload_to='modules/')),
                ('logo_img',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='module_logos',
                     to='content_management.LibLayoutImage')),
            ],
        ),
        migrations.AddField(
            model_name='libraryversion',
            name='library_modules',
            field=models.ManyToManyField(
                blank=True, to='content_management.LibraryModule'),
        ),
    ]
예제 #2
0
class Migration(migrations.Migration):

    dependencies = [
        ('content_management', '0019_auto_20180416_1336'),
    ]

    operations = [
        migrations.AddField(
            model_name='content',
            name='original_file_name',
            field=models.CharField(max_length=300, null=True),
        ),
        migrations.AlterField(
            model_name='content',
            name='content_file',
            field=models.FileField(upload_to=content_management.models.Content.set_original_name, verbose_name='File'),
        ),
    ]
예제 #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('content_management', '0014_auto_20180409_2316'),
    ]

    operations = [
        migrations.AddField(
            model_name='directorylayout',
            name='banner_file',
            field=models.FileField(default='',
                                   upload_to=content_management.models.
                                   DirectoryLayout.set_original_name),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='directorylayout',
            name='original_file_name',
            field=models.CharField(max_length=200, null=True),
        ),
    ]
예제 #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Content',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_name', models.CharField(max_length=300)),
                ('content_file', models.FileField(max_length=300, upload_to=content_management.models.Content.set_file_name, verbose_name='File')),
                ('title', models.CharField(max_length=300)),
                ('description', models.TextField(null=True)),
                ('modified_on', models.DateTimeField(default=datetime.datetime.now)),
                ('copyright', models.CharField(max_length=500, null=True)),
                ('rights_statement', models.TextField(null=True)),
                ('published_date', models.DateField(null=True)),
                ('active', models.BooleanField(default=1)),
            ],
            options={
                'ordering': ['pk'],
            },
        ),
        migrations.CreateModel(
            name='LibLayoutImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image_file', models.FileField(upload_to=content_management.models.LibLayoutImage.get_folder_name)),
                ('image_group', models.PositiveSmallIntegerField(choices=[(1, 'Logo'), (2, 'Banner'), (3, 'Version')], default=3)),
            ],
        ),
        migrations.CreateModel(
            name='MetadataType',
            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='Metadata',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
                ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content_management.MetadataType')),
            ],
        ),
        migrations.CreateModel(
            name='LibraryVersion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('library_name', models.CharField(max_length=300)),
                ('version_number', models.CharField(max_length=300)),
                ('library_banner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='versions', to='content_management.LibLayoutImage')),
            ],
        ),
        migrations.CreateModel(
            name='LibraryFolder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('folder_name', models.CharField(max_length=300)),
                ('banner_img', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='banners', to='content_management.LibLayoutImage')),
                ('library_content', models.ManyToManyField(blank=True, to='content_management.Content')),
                ('logo_img', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='logos', to='content_management.LibLayoutImage')),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='subfolders', to='content_management.LibraryFolder')),
                ('version', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='folders', to='content_management.LibraryVersion')),
            ],
        ),
        migrations.AddField(
            model_name='content',
            name='metadata',
            field=models.ManyToManyField(to='content_management.Metadata'),
        ),
    ]