djangocms_blog.cms_plugins

Plugin models

class djangocms_blog.models.BasePostPlugin(*args, **kwargs)
class Meta
optimize(qs)

Apply select_related / prefetch_related to optimize the view queries :param qs: queryset to optimize :return: optimized queryset

class djangocms_blog.models.LatestPostsPlugin(id, path, depth, numchild, placeholder, parent, position, language, plugin_type, creation_date, changed_date, cmsplugin_ptr, app_config, current_site, template_folder, latest_posts)
exception DoesNotExist
exception MultipleObjectsReturned
copy_relations(oldinstance)

Handle copying of any relations attached to this plugin. Custom plugins have to do this themselves!

class djangocms_blog.models.AuthorEntriesPlugin(id, path, depth, numchild, placeholder, parent, position, language, plugin_type, creation_date, changed_date, cmsplugin_ptr, app_config, current_site, template_folder, latest_posts)
exception DoesNotExist
exception MultipleObjectsReturned
copy_relations(oldinstance)

Handle copying of any relations attached to this plugin. Custom plugins have to do this themselves!

class djangocms_blog.models.GenericBlogPlugin(id, path, depth, numchild, placeholder, parent, position, language, plugin_type, creation_date, changed_date, cmsplugin_ptr, app_config, current_site, template_folder)
exception DoesNotExist
exception MultipleObjectsReturned

Plugin forms

class djangocms_blog.forms.BlogPluginForm(*args, **kwargs)

Base plugin form to inject the list of configured template folders from BLOG_PLUGIN_TEMPLATE_FOLDERS.

property media

Return all media required to render the widgets on this form.

class djangocms_blog.forms.LatestEntriesForm(*args, **kwargs)

Custom forms for BlogLatestEntriesPlugin to properly load taggit-autosuggest.

property media

Return all media required to render the widgets on this form.

class djangocms_blog.forms.AuthorPostsForm(*args, **kwargs)

Custom form for BlogAuthorPostsPlugin to apply distinct to the list of authors in plugin changeform.

property media

Return all media required to render the widgets on this form.

Plugin classes

class djangocms_blog.cms_plugins.BlogArchivePlugin(model=None, admin_site=None)

Render the list of months with available posts.

get_exclude(request, obj=None)

Exclude ‘template_folder’ field if BLOG_PLUGIN_TEMPLATE_FOLDERS contains one folder.

model

alias of GenericBlogPlugin

render(context, instance, placeholder)

Render the plugin.

class djangocms_blog.cms_plugins.BlogAuthorPostsListPlugin(model=None, admin_site=None)

Render the list of posts for each selected author.

get_fields(request, obj=None)

Return the fields available when editing the plugin.

‘template_folder’ field is added if BLOG_PLUGIN_TEMPLATE_FOLDERS contains multiple folders.

class djangocms_blog.cms_plugins.BlogAuthorPostsPlugin(model=None, admin_site=None)

Render the list of authors.

form

alias of AuthorPostsForm

get_fields(request, obj=None)

Return the fields available when editing the plugin.

‘template_folder’ field is added if BLOG_PLUGIN_TEMPLATE_FOLDERS contains multiple folders.

model

alias of AuthorEntriesPlugin

render(context, instance, placeholder)

Render the plugin.

class djangocms_blog.cms_plugins.BlogCategoryPlugin(model=None, admin_site=None)

Render the list of post categories.

get_exclude(request, obj=None)

Exclude ‘template_folder’ field if BLOG_PLUGIN_TEMPLATE_FOLDERS contains one folder.

model

alias of GenericBlogPlugin

render(context, instance, placeholder)

Render the plugin.

class djangocms_blog.cms_plugins.BlogFeaturedPostsPlugin(model=None, admin_site=None)

Return the selected posts which bypasses cache.

form

alias of BlogPluginForm

get_fields(request, obj=None)

Return the fields available when editing the plugin.

‘template_folder’ field is added if BLOG_PLUGIN_TEMPLATE_FOLDERS contains multiple folders.

model

alias of FeaturedPostsPlugin

render(context, instance, placeholder)

Render the plugin.

class djangocms_blog.cms_plugins.BlogFeaturedPostsPluginCached(model=None, admin_site=None)

Return the selected posts caching the result.

class djangocms_blog.cms_plugins.BlogLatestEntriesPlugin(model=None, admin_site=None)

Return the latest published posts which bypasses cache, taking into account the user / toolbar state.

form

alias of LatestEntriesForm

get_fields(request, obj=None)

Return the fields available when editing the plugin.

‘template_folder’ field is added if BLOG_PLUGIN_TEMPLATE_FOLDERS contains multiple folders.

model

alias of LatestPostsPlugin

render(context, instance, placeholder)

Render the plugin.

class djangocms_blog.cms_plugins.BlogLatestEntriesPluginCached(model=None, admin_site=None)

Return the latest published posts caching the result.

class djangocms_blog.cms_plugins.BlogPlugin(model=None, admin_site=None)
form

alias of BlogPluginForm

get_render_template(context, instance, placeholder)

Select the template used to render the plugin.

Check the default folder as well as the folders provided to the apphook config.

class djangocms_blog.cms_plugins.BlogTagsPlugin(model=None, admin_site=None)

Render the list of post tags.

get_exclude(request, obj=None)

Exclude ‘template_folder’ field if BLOG_PLUGIN_TEMPLATE_FOLDERS contains one folder.

model

alias of GenericBlogPlugin

render(context, instance, placeholder)

Render the plugin.