Merge pull request #201 from skirsdeda/filer_migration_fix

fix migration 0007 to use swappable dependency
This commit is contained in:
Iacopo Spalletti 2016-02-15 19:39:11 +01:00
commit 62e8d4429b
3 changed files with 23 additions and 11 deletions

View file

@ -8,13 +8,17 @@ import filer.fields.image
import meta_mixin.models
import taggit_autosuggest.managers
from django.conf import settings
from django.db import models, migrations
from django.db import migrations, models
from filer.settings import FILER_IMAGE_MODEL
ACTUAL_FILER_IMAGE_MODEL = FILER_IMAGE_MODEL or 'filer.Image'
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
migrations.swappable_dependency(ACTUAL_FILER_IMAGE_MODEL),
('cms', '__latest__'),
('taggit', '__latest__'),
('filer', '__latest__'),
@ -90,7 +94,7 @@ class Migration(migrations.Migration):
('author', models.ForeignKey(related_name='djangocms_blog_post_author', verbose_name='Author', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
('categories', models.ManyToManyField(related_name='blog_posts', verbose_name='category', to='djangocms_blog.BlogCategory')),
('content', cms.models.fields.PlaceholderField(slotname='post_content', editable=False, to='cms.Placeholder', null=True)),
('main_image', filer.fields.image.FilerImageField(related_name='djangocms_blog_post_image', verbose_name='Main image', blank=True, to='filer.Image', null=True)),
('main_image', filer.fields.image.FilerImageField(related_name='djangocms_blog_post_image', verbose_name='Main image', blank=True, to=ACTUAL_FILER_IMAGE_MODEL, null=True)),
('main_image_full', models.ForeignKey(related_name='djangocms_blog_post_full', verbose_name='Main image full', blank=True, to='cmsplugin_filer_image.ThumbnailOption', null=True)),
('main_image_thumbnail', models.ForeignKey(related_name='djangocms_blog_post_thumbnail', verbose_name='Main image thumbnail', blank=True, to='cmsplugin_filer_image.ThumbnailOption', null=True)),
('tags', taggit_autosuggest.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags')),

View file

@ -1,14 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import filer.fields.image
import django.db.models.deletion
import filer.fields.image
from django.db import migrations, models
from filer.settings import FILER_IMAGE_MODEL
ACTUAL_FILER_IMAGE_MODEL = FILER_IMAGE_MODEL or 'filer.Image'
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(ACTUAL_FILER_IMAGE_MODEL),
('djangocms_blog', '0003_auto_20141201_2252'),
]
@ -16,7 +20,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='post',
name='main_image',
field=filer.fields.image.FilerImageField(related_name='djangocms_blog_post_image', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Main image', blank=True, to='filer.Image', null=True),
field=filer.fields.image.FilerImageField(related_name='djangocms_blog_post_image', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Main image', blank=True, to=ACTUAL_FILER_IMAGE_MODEL, null=True),
preserve_default=True,
),
migrations.AlterField(

View file

@ -1,18 +1,22 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import filer.fields.image
import django.utils.timezone
from django.conf import settings
import djangocms_text_ckeditor.fields
import django.db.models.deletion
import django.utils.timezone
import djangocms_text_ckeditor.fields
import filer.fields.image
from django.conf import settings
from django.db import migrations, models
from filer.settings import FILER_IMAGE_MODEL
ACTUAL_FILER_IMAGE_MODEL = FILER_IMAGE_MODEL or 'filer.Image'
class Migration(migrations.Migration):
dependencies = [
('djangocms_blog', '0006_auto_20150214_1907'),
migrations.swappable_dependency(ACTUAL_FILER_IMAGE_MODEL),
]
operations = [
@ -99,7 +103,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='post',
name='main_image',
field=filer.fields.image.FilerImageField(on_delete=django.db.models.deletion.SET_NULL, blank=True, verbose_name='main image', to='filer.Image', related_name='djangocms_blog_post_image', null=True),
field=filer.fields.image.FilerImageField(on_delete=django.db.models.deletion.SET_NULL, blank=True, verbose_name='main image', to=ACTUAL_FILER_IMAGE_MODEL, related_name='djangocms_blog_post_image', null=True),
preserve_default=True,
),
migrations.AlterField(