diff --git a/.travis.yml b/.travis.yml index 566fb513..ff5d36de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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: diff --git a/README.rst b/README.rst index d2cce0ca..2eec1c4b 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/cms_helper.py b/cms_helper.py index 3446127f..5d6c6a69 100755 --- a/cms_helper.py +++ b/cms_helper.py @@ -20,7 +20,6 @@ def gettext(s): 'easy_thumbnails', 'django.contrib.sitemaps', 'djangocms_text_ckeditor', - 'cmsplugin_filer_image', 'taggit', 'taggit_autosuggest', 'aldryn_apphooks_config', diff --git a/djangocms_blog/cms_appconfig.py b/djangocms_blog/cms_appconfig.py index 785c770d..5483fa27 100644 --- a/djangocms_blog/cms_appconfig.py +++ b/djangocms_blog/cms_appconfig.py @@ -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): """ diff --git a/djangocms_blog/migrations/0001_initial.py b/djangocms_blog/migrations/0001_initial.py index c19875bf..50f1150b 100644 --- a/djangocms_blog/migrations/0001_initial.py +++ b/djangocms_blog/migrations/0001_initial.py @@ -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( diff --git a/djangocms_blog/migrations/0004_auto_20150108_1435.py b/djangocms_blog/migrations/0004_auto_20150108_1435.py index dc2eb1ca..db4ecfae 100644 --- a/djangocms_blog/migrations/0004_auto_20150108_1435.py +++ b/djangocms_blog/migrations/0004_auto_20150108_1435.py @@ -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( diff --git a/djangocms_blog/migrations/0007_auto_20150719_0933.py b/djangocms_blog/migrations/0007_auto_20150719_0933.py index 56472f52..63836744 100644 --- a/djangocms_blog/migrations/0007_auto_20150719_0933.py +++ b/djangocms_blog/migrations/0007_auto_20150719_0933.py @@ -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( diff --git a/djangocms_blog/migrations/0017_thumbnail_move.py b/djangocms_blog/migrations/0017_thumbnail_move.py index b6d3a7bd..178d8403 100644 --- a/djangocms_blog/migrations/0017_thumbnail_move.py +++ b/djangocms_blog/migrations/0017_thumbnail_move.py @@ -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 = [] diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index c64a4347..d77b40ff 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -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 @@ -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__ diff --git a/docs/cmsplugin_filer.rst b/docs/cmsplugin_filer.rst new file mode 100644 index 00000000..0fa17c4f --- /dev/null +++ b/docs/cmsplugin_filer.rst @@ -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 diff --git a/docs/index.rst b/docs/index.rst index 6a86de6b..343362f8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,6 +21,7 @@ Contents settings features channels + cmsplugin_filer development contributing history diff --git a/setup.py b/setup.py index 4128069f..e3db1db1 100755 --- a/setup.py +++ b/setup.py @@ -27,19 +27,17 @@ ], include_package_data=True, install_requires=[ - 'django-parler>=1.5', - 'django-cms>=3.2', + 'django-parler>=1.9', + 'django-cms>=3.4', 'django-taggit>=0.12.2', - 'django-filer>=1.1', + 'django-filer>=1.3', 'pytz', 'django-taggit-templatetags', 'django-taggit-autosuggest', - 'djangocms-text-ckeditor', - 'cmsplugin-filer>=1.0', + 'djangocms-text-ckeditor>=3.5', 'easy-thumbnails>=2.4.1', - 'django-meta>=1.2', - 'django-meta-mixin>=0.3', - 'aldryn-apphooks-config>=0.2.6', + 'django-meta>=1.4', + 'aldryn-apphooks-config>=0.4', 'djangocms-apphook-setup', 'django-sortedm2m', 'lxml', @@ -59,8 +57,6 @@ 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Framework :: Django', - 'Framework :: Django :: 1.8', - 'Framework :: Django :: 1.9', 'Framework :: Django :: 1.11', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7',