Skip to content

Commit

Permalink
Remove compatibility shims
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Apr 9, 2018
1 parent 781c12b commit 277c110
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 191 deletions.
46 changes: 0 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ env:
- TOXENV='docs'
- DJANGO='django111' CMS='cms35'
- DJANGO='django111' CMS='cms34'
- DJANGO='django110' CMS='cms35'
- DJANGO='django110' CMS='cms34'
- DJANGO='django19' CMS='cms35'
- DJANGO='django19' CMS='cms34'
- DJANGO='django19' CMS='cms33'
- DJANGO='django19' CMS='cms32'
- DJANGO='django18' CMS='cms35'
- DJANGO='django18' CMS='cms34'
- DJANGO='django18' CMS='cms33'
- DJANGO='django18' CMS='cms32'


# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
Expand Down Expand Up @@ -66,42 +56,6 @@ matrix:
env: TOXENV='pep8'
- python: 3.5
env: TOXENV='isort'
- python: 2.7
env: DJANGO='django110' CMS='cms35'
- python: 2.7
env: DJANGO='django110' CMS='cms34'
- python: 2.7
env: DJANGO='django19' CMS='cms35'
- python: 2.7
env: DJANGO='django19' CMS='cms34'
- python: 2.7
env: DJANGO='django19' CMS='cms33'
- python: 2.7
env: DJANGO='django19' CMS='cms32'
- python: 3.5
env: DJANGO='django110' CMS='cms35'
- python: 3.5
env: DJANGO='django110' CMS='cms34'
- python: 3.5
env: DJANGO='django19' CMS='cms35'
- python: 3.5
env: DJANGO='django19' CMS='cms34'
- python: 3.5
env: DJANGO='django19' CMS='cms33'
- python: 3.5
env: DJANGO='django19' CMS='cms32'
- python: 3.4
env: DJANGO='django110' CMS='cms35'
- python: 3.4
env: DJANGO='django110' CMS='cms34'
- python: 3.4
env: DJANGO='django19' CMS='cms35'
- python: 3.4
env: DJANGO='django19' CMS='cms34'
- python: 3.4
env: DJANGO='django19' CMS='cms33'
- python: 3.4
env: DJANGO='django19' CMS='cms32'


cache:
Expand Down
63 changes: 3 additions & 60 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,15 @@ django CMS blog application - Support for multilingual posts, placeholders, soci

Supported Django versions:

* Django 1.8
* Django 1.9
* Django 1.10
* Django 1.11

Supported django CMS versions:

* django CMS 3.2+
* django CMS 3.4+

.. warning:: Strict dependency on aldryn-search, haystack has been dropped. Install
them separately to enable full text search support. See `installation docs`_
for details.
.. warning:: For Django<1.11, django CMS<3.4 versions support, use djangocms 0.9.

.. warning:: Version 0.8 will be the last one supporting Python 2.6, Python 3.3,
Django<1.8 and django CMS<3.2.

.. warning:: Starting from version 0.8, date_published is not set anymore
when creating a post but rather when publishing.
This does not change the overall behavior, but be warned if you
expect it to be not null in custom code.

*****************************************
Upgrading cmsplugin-filer from 1.0 to 1.1
*****************************************

Due to changes in cmsplugin-filer/filer which moved ``ThumbnailOption`` model from the
former to the latter, ``djangocms-blog`` must be migrated as well.

Migrating cmsplugin-filer to 1.1 and djangocms-blog up to 0.8.4
===============================================================

If you have djangocms-blog up to 0.8.4 (included) installed or you are upgrading from a previous
djangocms-blog version together with cmsplugin-filer upgrade, you can just apply the migrations::

pip install cmsplugin-filer==1.1.3 django-filer==1.2.7 djangocms-blog==0.8.4
python manage.py migrate

Migrating cmsplugin-filer to 1.1 and djangocms-blog 0.8.5+
==========================================================

If you already a djangocms-blog 0.8.5+ up to 0.8.11, upgrade to 0.8.11, then
you have to de-apply some blog migrations when doing the upgrade::

pip install djangocms-blog==0.8.11
python manage.py migrate djangocms_blog 0017 ## reverse for these migration is a noop
pip install cmsplugin-filer==1.1.3 django-filer==1.2.7
python manage.py migrate

After this step you can upgrade to 0.8.12::

pip install djangocms-blog==0.8.12

.. note:: de-apply migration **before** upgrading cmsplugin-filer. If running before upgrade, the
backward migration won't alter anything on the database, and it will just allow the code
to migrate ``ThumbnailOption`` from cmsplugin-filer to filer

.. note:: If you upgrade in a Django 1.10 environment, be sure to upgrade both packages
at the same time to allow correct migration dependencies to be evaluated.

Installing djangocms-blog in an existing project with Django 1.10
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If your project has cmsplugin-filer 1.1+ already installed and it uses Django 1.10,
install djangocms-blog 0.8.12 (and above)::

pip install djangocms-blog==0.8.12
.. warning:: Since 1.0 compatibility with cmsplugin-filer has been dropped. Check

********
Features
Expand Down
1 change: 0 additions & 1 deletion cms_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def gettext(s):
'easy_thumbnails',
'django.contrib.sitemaps',
'djangocms_text_ckeditor',
'cmsplugin_filer_image',
'taggit',
'taggit_autosuggest',
'aldryn_apphooks_config',
Expand Down
6 changes: 1 addition & 5 deletions djangocms_blog/cms_appconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
from django import forms
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.models import ThumbnailOption
from parler.models import TranslatableModel, TranslatedFields

from .settings import MENU_TYPE_COMPLETE, get_setting

try: # pragma: no cover
from cmsplugin_filer_image.models import ThumbnailOption # NOQA
except ImportError: # pragma: no cover
from filer.models import ThumbnailOption # NOQA


class BlogConfig(TranslatableModel, AppHookConfig):
"""
Expand Down
14 changes: 2 additions & 12 deletions djangocms_blog/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,13 @@

class Migration(migrations.Migration):

if 'cmsplugin_filer' not in thumbnail_model:
filer_dependencies = [
('filer', '0003_thumbnailoption'),
('cmsplugin_filer_image', '0003_mv_thumbnail_option_to_filer_20160119_1720'),
]
else:
filer_dependencies = [
('filer', '__first__'),
('cmsplugin_filer_image', '__first__'),
]

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
migrations.swappable_dependency(ACTUAL_FILER_IMAGE_MODEL),
('cms', '__first__'),
('taggit', '__first__'),
] + filer_dependencies
('filer', '0003_thumbnailoption'),
]

operations = [
migrations.CreateModel(
Expand Down
13 changes: 2 additions & 11 deletions djangocms_blog/migrations/0004_auto_20150108_1435.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@

class Migration(migrations.Migration):

if 'cmsplugin_filer' not in thumbnail_model:
filer_dependencies = [
('filer', '0003_thumbnailoption'),
('cmsplugin_filer_image', '0003_mv_thumbnail_option_to_filer_20160119_1720'),
]
else:
filer_dependencies = [
('filer', '__first__'),
('cmsplugin_filer_image', '__first__'),
]

dependencies = [
migrations.swappable_dependency(ACTUAL_FILER_IMAGE_MODEL),
('djangocms_blog', '0003_auto_20141201_2252'),
] + filer_dependencies
('filer', '0003_thumbnailoption'),
]

operations = [
migrations.AlterField(
Expand Down
14 changes: 2 additions & 12 deletions djangocms_blog/migrations/0007_auto_20150719_0933.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@

class Migration(migrations.Migration):

if 'cmsplugin_filer' not in thumbnail_model:
filer_dependencies = [
('filer', '0003_thumbnailoption'),
('cmsplugin_filer_image', '0003_mv_thumbnail_option_to_filer_20160119_1720'),
]
else:
filer_dependencies = [
('filer', '__first__'),
('cmsplugin_filer_image', '__first__'),
]

dependencies = [
('djangocms_blog', '0006_auto_20150214_1907'),
migrations.swappable_dependency(ACTUAL_FILER_IMAGE_MODEL),
] + filer_dependencies
('filer', '0003_thumbnailoption'),
]

operations = [
migrations.AlterModelOptions(
Expand Down
35 changes: 5 additions & 30 deletions djangocms_blog/migrations/0017_thumbnail_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,9 @@

class Migration(migrations.Migration):

if 'cmsplugin_filer' not in thumbnail_model:
dependencies = [
('djangocms_blog', '0016_auto_20160502_1741'),
('filer', '0003_thumbnailoption'),
('cmsplugin_filer_image', '0003_mv_thumbnail_option_to_filer_20160119_1720'),
]
dependencies = [
('filer', '0003_thumbnailoption'),
('djangocms_blog', '0016_auto_20160502_1741'),
]

operations = [
migrations.AlterField(
model_name='post',
name='main_image_full',
field=models.ForeignKey(related_name='djangocms_blog_post_full',
verbose_name='Main image full', blank=True,
to=thumbnail_model, null=True),
),
migrations.AlterField(
model_name='post',
name='main_image_thumbnail',
field=models.ForeignKey(related_name='djangocms_blog_post_thumbnail',
verbose_name='Main image thumbnail', blank=True,
to=thumbnail_model, null=True),
),
]
else:
dependencies = [
('filer', '__first__'),
('cmsplugin_filer_image', '__first__'),
('djangocms_blog', '0016_auto_20160502_1741'),
]

operations = []
operations = []
5 changes: 1 addition & 4 deletions djangocms_blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from django.utils.translation import get_language, ugettext, ugettext_lazy as _
from djangocms_text_ckeditor.fields import HTMLField
from filer.fields.image import FilerImageField
from filer.models import ThumbnailOption
from meta.models import ModelMeta
from parler.models import TranslatableModel, TranslatedFields
from parler.utils.context import switch_language
Expand All @@ -36,10 +37,6 @@
BLOG_CURRENT_NAMESPACE = get_setting('CURRENT_NAMESPACE')
BLOG_PLUGIN_TEMPLATE_FOLDERS = get_setting('PLUGIN_TEMPLATE_FOLDERS')

try: # pragma: no cover
from cmsplugin_filer_image.models import ThumbnailOption # NOQA
except ImportError: # pragma: no cover
from filer.models import ThumbnailOption # NOQA

thumbnail_model = '%s.%s' % (
ThumbnailOption._meta.app_label, ThumbnailOption.__name__
Expand Down
65 changes: 65 additions & 0 deletions docs/cmsplugin_filer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. _filer:

=======================
filer / cmsplugin-filer
=======================

``djangocms-blog`` uses the ``ThumbnailOption`` model from ``cmsplugin-filer`` / ``django-filer``.

``ThumbnailOption`` model used to be in ``cmsplugin-filer`` up to version 1.0 included.

Since ``cmsplugin-filer`` 1.1 has been moved to ``django-filer`` (since version 1.2).

``djangocms-blog`` introduced compatibility shims to support both combinations.

Since ``djangocms-blog`` 1.0 the compatibility has been dropped and ``django-filer`` 1.3 is required
for ``djangocms-blog`` to work.

See below the migration path if you still use older versions of ``cmsplugin-filer`` / ``django-filer``.

*****************************************
Upgrading cmsplugin-filer from 1.0 to 1.1
*****************************************

Due to changes in ``cmsplugin-filer`` / ``django-filer`` which moved
``ThumbnailOption`` model from the former to the latter, ``djangocms-blog``
must be migrated as well.

Migrating cmsplugin-filer to 1.1 and djangocms-blog up to 0.8.4
===============================================================

If you have djangocms-blog up to 0.8.4 (included) installed or you are upgrading from a previous
djangocms-blog version together with cmsplugin-filer upgrade, you can just apply the migrations::

pip install cmsplugin-filer==1.1.3 django-filer==1.2.7 djangocms-blog==0.8.4
python manage.py migrate

Migrating cmsplugin-filer to 1.1 and djangocms-blog 0.8.5+
==========================================================

If you already a djangocms-blog 0.8.5+ up to 0.8.11, upgrade to 0.8.11, then
you have to de-apply some blog migrations when doing the upgrade::

pip install djangocms-blog==0.8.11
python manage.py migrate djangocms_blog 0017 ## reverse for these migration is a noop
pip install cmsplugin-filer==1.1.3 django-filer==1.2.7
python manage.py migrate

After this step you can upgrade to 0.8.12::

pip install djangocms-blog==0.8.12

.. note:: de-apply migration **before** upgrading cmsplugin-filer. If running before upgrade, the
backward migration won't alter anything on the database, and it will just allow the code
to migrate ``ThumbnailOption`` from cmsplugin-filer to filer

.. note:: If you upgrade in a Django 1.10 environment, be sure to upgrade both packages
at the same time to allow correct migration dependencies to be evaluated.

Installing djangocms-blog in an existing project with Django 1.10
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If your project has cmsplugin-filer 1.1+ already installed and it uses Django 1.10,
install djangocms-blog 0.8.12 (and above)::

pip install djangocms-blog==0.8.12
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Contents
settings
features
channels
cmsplugin_filer
development
contributing
history
Expand Down
Loading

0 comments on commit 277c110

Please sign in to comment.