diff --git a/HISTORY.rst b/HISTORY.rst index 38b7f41..0e95cc6 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,8 +6,10 @@ History 0.5.0 (XXXX-XX-XX) ++++++++++++++++++ +* Add support for Django 1.8 * Drop dependency on Django select2 * Code cleanups +* Enforce flake8 / isort checks 0.4.0 (2015-03-22) ++++++++++++++++++ diff --git a/cms_helper.py b/cms_helper.py index 0ba692e..864086e 100755 --- a/cms_helper.py +++ b/cms_helper.py @@ -11,15 +11,14 @@ HELPER_SETTINGS = dict( ], ROOT_URLCONF='tests.test_utils.urls', INSTALLED_APPS=[ - 'admin_enhancer', 'filer', 'parler', - 'taggit', 'meta', 'meta_mixin', 'easy_thumbnails', 'djangocms_text_ckeditor', 'cmsplugin_filer_image', + 'taggit', 'taggit_autosuggest', ], LANGUAGE_CODE='en', @@ -91,6 +90,12 @@ HELPER_SETTINGS = dict( if 'test' in sys.argv or len(sys.argv) == 1: HELPER_SETTINGS['INSTALLED_APPS'].append('django_nose') +try: + import admin_enhancer + HELPER_SETTINGS['INSTALLED_APPS'].append('admin_enhancer') +except ImportError: + pass + def run(): from djangocms_helper import runner diff --git a/djangocms_blog/admin.py b/djangocms_blog/admin.py index f74de80..c8f7b88 100755 --- a/djangocms_blog/admin.py +++ b/djangocms_blog/admin.py @@ -1,7 +1,11 @@ # -*- coding: utf-8 -*- from copy import deepcopy -from admin_enhancer.admin import EnhancedModelAdminMixin +try: + from admin_enhancer.admin import EnhancedModelAdminMixin +except ImportError: + class EnhancedModelAdminMixin(object): + pass from cms.admin.placeholderadmin import FrontendEditableAdminMixin, PlaceholderAdminMixin from django import forms from django.conf import settings diff --git a/djangocms_blog/migrations/0001_initial.py b/djangocms_blog/migrations/0001_initial.py index 31f1769..3e993ba 100644 --- a/djangocms_blog/migrations/0001_initial.py +++ b/djangocms_blog/migrations/0001_initial.py @@ -1,25 +1,24 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.db import models, migrations -import taggit_autosuggest.managers -import filer.fields.image -import meta_mixin.models -import djangocms_text_ckeditor.fields import cms.models.fields import django.utils.timezone +import djangocms_text_ckeditor.fields +import filer.fields.image +import meta_mixin.models +import taggit_autosuggest.managers from django.conf import settings -from django.conf import settings +from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('cms', '0003_auto_20140926_2347'), - ('taggit', '__first__'), - ('filer', '0001_initial'), - ('cmsplugin_filer_image', '0001_initial'), + ('cms', '__latest__'), + ('taggit', '__latest__'), + ('filer', '__latest__'), + ('cmsplugin_filer_image', '__latest__'), ] operations = [ diff --git a/djangocms_blog/migrations/0002_post_sites.py b/djangocms_blog/migrations/0002_post_sites.py index 3f973ab..9a7a980 100644 --- a/djangocms_blog/migrations/0002_post_sites.py +++ b/djangocms_blog/migrations/0002_post_sites.py @@ -7,7 +7,7 @@ from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ - ('sites', '0001_initial'), + ('sites', '__latest__'), ('djangocms_blog', '0001_initial'), ] diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index 8124109..fcb8a71 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- from cms.models import CMSPlugin, PlaceholderField -from cmsplugin_filer_image.models import ThumbnailOption from django.conf import settings as dj_settings -from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone @@ -87,31 +85,28 @@ class Post(ModelMeta, TranslatableModel): date_published_end = models.DateTimeField(_(u'published Until'), null=True, blank=True) publish = models.BooleanField(_(u'publish'), default=False) - categories = models.ManyToManyField(BlogCategory, verbose_name=_(u'category'), + categories = models.ManyToManyField('djangocms_blog.BlogCategory', verbose_name=_(u'category'), related_name='blog_posts',) main_image = FilerImageField(verbose_name=_(u'main image'), blank=True, null=True, on_delete=models.SET_NULL, related_name='djangocms_blog_post_image') - main_image_thumbnail = models.ForeignKey(ThumbnailOption, + main_image_thumbnail = models.ForeignKey('cmsplugin_filer_image.ThumbnailOption', verbose_name=_(u'main image thumbnail'), related_name='djangocms_blog_post_thumbnail', on_delete=models.SET_NULL, blank=True, null=True) - main_image_full = models.ForeignKey(ThumbnailOption, + main_image_full = models.ForeignKey('cmsplugin_filer_image.ThumbnailOption', verbose_name=_(u'main image full'), related_name='djangocms_blog_post_full', on_delete=models.SET_NULL, blank=True, null=True) - enable_comments = models.BooleanField( - verbose_name=_(u'enable comments on post'), - default=get_setting('ENABLE_COMMENTS') - ) - sites = models.ManyToManyField(Site, verbose_name=_(u'Site(s)'), blank=True, + enable_comments = models.BooleanField(verbose_name=_(u'enable comments on post'), + default=get_setting('ENABLE_COMMENTS')) + sites = models.ManyToManyField('sites.Site', verbose_name=_(u'Site(s)'), blank=True, null=True, help_text=_(u'Select sites in which to show the post. ' u'If none is set it will be ' - u'visible in all the configured sites.') - ) + u'visible in all the configured sites.')) translations = TranslatedFields( title=models.CharField(_(u'title'), max_length=255), @@ -254,7 +249,7 @@ class LatestPostsPlugin(BasePostPlugin): help_text=_(u'The number of latests articles to be displayed.')) tags = models.ManyToManyField('taggit.Tag', blank=True, verbose_name=_(u'filter by tag'), help_text=_(u'Show only the blog articles tagged with chosen tags.')) - categories = models.ManyToManyField('BlogCategory', blank=True, verbose_name=_(u'filter by category'), + categories = models.ManyToManyField('djangocms_blog.BlogCategory', blank=True, verbose_name=_(u'filter by category'), help_text=_(u'Show only the blog articles tagged with chosen categories.')) def __str__(self): diff --git a/djangocms_blog/templates/djangocms_blog/includes/blog_item.html b/djangocms_blog/templates/djangocms_blog/includes/blog_item.html index 246aa6b..a9bfc3d 100644 --- a/djangocms_blog/templates/djangocms_blog/includes/blog_item.html +++ b/djangocms_blog/templates/djangocms_blog/includes/blog_item.html @@ -1,5 +1,4 @@ {% load i18n thumbnail cms_tags %} -{% load url from future %}
diff --git a/djangocms_blog/templates/djangocms_blog/includes/blog_meta.html b/djangocms_blog/templates/djangocms_blog/includes/blog_meta.html index 3c3d27f..37eb62a 100644 --- a/djangocms_blog/templates/djangocms_blog/includes/blog_meta.html +++ b/djangocms_blog/templates/djangocms_blog/includes/blog_meta.html @@ -1,5 +1,4 @@ {% load i18n thumbnail cms_tags %} -{% load url from future %}