diff --git a/djangocms_blog/cms_plugins.py b/djangocms_blog/cms_plugins.py index 665809d..6bb6357 100644 --- a/djangocms_blog/cms_plugins.py +++ b/djangocms_blog/cms_plugins.py @@ -14,7 +14,7 @@ class BlogPlugin(CMSPluginBase): module = 'Blog' -class LatestEntriesPlugin(BlogPlugin): +class BlogLatestEntriesPlugin(BlogPlugin): render_template = 'djangocms_blog/plugins/latest_entries.html' name = _('Latest Blog Articles') @@ -28,7 +28,7 @@ class LatestEntriesPlugin(BlogPlugin): return context -class AuthorPostsPlugin(BlogPlugin): +class BlogAuthorPostsPlugin(BlogPlugin): module = _('Blog') name = _('Author Blog Articles') model = AuthorEntriesPlugin @@ -74,8 +74,8 @@ class BlogArchivePlugin(BlogPlugin): return context -plugin_pool.register_plugin(LatestEntriesPlugin) -plugin_pool.register_plugin(AuthorPostsPlugin) +plugin_pool.register_plugin(BlogLatestEntriesPlugin) +plugin_pool.register_plugin(BlogAuthorPostsPlugin) plugin_pool.register_plugin(BlogTagsPlugin) plugin_pool.register_plugin(BlogArchivePlugin) plugin_pool.register_plugin(BlogCategoryPlugin) diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index 1aca99e..7ccc5e8 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -19,11 +19,10 @@ from .managers import GenericDateTaggedManager BLOG_CURRENT_POST_IDENTIFIER = 'djangocms_post_current' + class BlogCategory(TranslatableModel): """ Blog category - - """ parent = models.ForeignKey('self', verbose_name=_('parent'), null=True, blank=True) @@ -62,7 +61,8 @@ class Post(TranslatableModel): """ Blog post """ - author = models.ForeignKey(User, verbose_name=_('Author'), null=True, blank=True) + author = models.ForeignKey(User, verbose_name=_('Author'), null=True, blank=True, + related_name='djangocms_blog_author') date_created = models.DateTimeField(auto_now_add=True) date_modified = models.DateTimeField(auto_now=True) @@ -73,7 +73,8 @@ class Post(TranslatableModel): publish = models.BooleanField(_('Publish'), default=False) categories = models.ManyToManyField(BlogCategory, verbose_name=_('category'), related_name='blog_posts',) - main_image = FilerImageField(verbose_name=_('Main image'), blank=True, null=True) + main_image = FilerImageField(verbose_name=_('Main image'), blank=True, null=True, + related_name='djangocmsblog_post_image') main_image_thumbnail = models.ForeignKey(ThumbnailOption, verbose_name=_('Main image thumbnail'), related_name='blog_post_thumbnail', @@ -96,7 +97,7 @@ class Post(TranslatableModel): content = PlaceholderField("post_content") objects = GenericDateTaggedManager() - tags = TaggableManager(blank=True) + tags = TaggableManager(blank=True, related_name='djangocms_blog_tags') class Meta: verbose_name = _('blog article')