diff --git a/djangocms_blog/cms_plugins.py b/djangocms_blog/cms_plugins.py index 77cce05..f9d1736 100644 --- a/djangocms_blog/cms_plugins.py +++ b/djangocms_blog/cms_plugins.py @@ -37,7 +37,7 @@ class BlogLatestEntriesPlugin(BlogPlugin): form = LatestEntriesForm filter_horizontal = ('categories',) fields = ['app_config', 'latest_posts', 'tags', 'categories'] + \ - ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS'))>1 else [] + ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS')) > 1 else [] cache = False base_render_template = 'latest_entries.html' @@ -56,8 +56,8 @@ class BlogLatestEntriesPluginCached(BlogPlugin): model = LatestPostsPlugin form = LatestEntriesForm filter_horizontal = ('categories',) - fields = ['app_config', 'latest_posts', 'tags', 'categories']+ \ - ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS'))>1 else [] + fields = ['app_config', 'latest_posts', 'tags', 'categories'] + \ + ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS')) > 1 else [] base_render_template = 'latest_entries.html' def render(self, context, instance, placeholder): @@ -73,7 +73,7 @@ class BlogAuthorPostsPlugin(BlogPlugin): model = AuthorEntriesPlugin base_render_template = 'authors.html' filter_horizontal = ['authors'] - exclude = ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS'))>=1 else [] + exclude = ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS')) >= 1 else [] def render(self, context, instance, placeholder): context = super(BlogAuthorPostsPlugin, self).render(context, instance, placeholder) @@ -121,7 +121,7 @@ class BlogArchivePlugin(BlogPlugin): name = get_setting('ARCHIVE_PLUGIN_NAME') model = GenericBlogPlugin base_render_template = 'archive.html' - exclude = ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS'))>=1 else [] + exclude = ['template_folder'] if len(get_setting('PLUGIN_TEMPLATE_FOLDERS')) >= 1 else [] def render(self, context, instance, placeholder): context = super(BlogArchivePlugin, self).render(context, instance, placeholder) diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index 7e040de..22c5309 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -380,11 +380,11 @@ class BasePostPlugin(CMSPlugin): _('current site'), default=True, help_text=_('Select items from the current site only') ) template_folder = models.CharField( - max_length = 40, - verbose_name = _('Plugin template'), - help_text = _('Select plugin template to load for this instance'), - default = BLOG_PLUGIN_TEMPLATE_FOLDERS[0][1], - choices = BLOG_PLUGIN_TEMPLATE_FOLDERS + max_length=40, + verbose_name=_('Plugin template'), + help_text=_('Select plugin template to load for this instance'), + default=BLOG_PLUGIN_TEMPLATE_FOLDERS[0][1], + choices=BLOG_PLUGIN_TEMPLATE_FOLDERS ) class Meta: