コード例 #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0063_auto_20170807_1747'),
    ]

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('file',
                 models.FileField(
                     storage=django.core.files.storage.FileSystemStorage(
                         base_url='/assets/',
                         location='/home/rehandalal/Projects/clublink/assets'),
                     upload_to=clublink.cms.models.get_file_upload_path)),
            ],
            bases=(dirtyfields.dirtyfields.DirtyFieldsMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Folder',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('full_path', models.CharField(max_length=255)),
                ('parent',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='folders',
                                   to='cms.Folder')),
            ],
        ),
        migrations.AddField(
            model_name='file',
            name='folder',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='files',
                to='cms.Folder'),
        ),
        migrations.AlterUniqueTogether(
            name='folder',
            unique_together=set([('name', 'parent')]),
        ),
        migrations.AlterUniqueTogether(
            name='file',
            unique_together=set([('name', 'folder')]),
        ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0071_auto_20170904_0005'),
    ]

    operations = [
        migrations.AlterField(
            model_name='file',
            name='file',
            field=models.FileField(storage=django.core.files.storage.FileSystemStorage(base_url='/asset_files/', location='/Users/thong/Projects/clublink/asset_files'), upload_to=clublink.cms.models.get_file_upload_path),
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0067_auto_20170814_0255'),
    ]

    operations = [
        migrations.AlterField(
            model_name='file',
            name='file',
            field=models.FileField(
                storage=clublink.base.storages.S3Boto3StorageAssets(
                    base_url='/asset_files/',
                    location='/var/www/clublink/asset_files'),
                upload_to=clublink.cms.models.get_file_upload_path),
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0066_auto_20170809_1012'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='file',
            options={'ordering': ('name',)},
        ),
        migrations.AlterModelOptions(
            name='folder',
            options={'ordering': ('name',)},
        ),
        migrations.AlterField(
            model_name='file',
            name='file',
            field=models.FileField(storage=django.core.files.storage.FileSystemStorage(base_url='/asset_files/', location='/home/rehandalal/Projects/clublink/asset_files'), upload_to=clublink.cms.models.get_file_upload_path),
        ),
    ]