Views

View classes for displaying stories and categories.

List Views

PostListView

class PostListView(**kwargs)[source]

Bases: BaseConfigListViewMixin, ListView

model

alias of PostContent

base_template_name = 'post_list.html'
view_url_name = 'djangocms_stories:posts-latest'

CategoryEntriesView

class CategoryEntriesView(**kwargs)[source]

Bases: BaseConfigListViewMixin, ListView

model

alias of PostContent

context_object_name = 'postcontent_list'
base_template_name = 'post_list.html'
view_url_name = 'djangocms_stories:posts-category'
property category
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

get_context_data(**kwargs)[source]

Get the context for this view.

TaggedListView

class TaggedListView(**kwargs)[source]

Bases: BaseConfigListViewMixin, ListView

model

alias of PostContent

context_object_name = 'postcontent_list'
base_template_name = 'post_list.html'
view_url_name = 'djangocms_stories:posts-tagged'
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

get_context_data(**kwargs)[source]

Get the context for this view.

AuthorEntriesView

class AuthorEntriesView(**kwargs)[source]

Bases: BaseConfigListViewMixin, ListView

model

alias of PostContent

context_object_name = 'postcontent_list'
base_template_name = 'post_list.html'
view_url_name = 'djangocms_stories:posts-author'
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

get_context_data(**kwargs)[source]

Get the context for this view.

Detail Views

PostDetailView

class PostDetailView(**kwargs)[source]

Bases: StoriesConfigMixin, DetailView

model

alias of PostContent

context_object_name = 'post_content'
base_template_name = 'post_detail.html'
slug_field = 'slug'
view_url_name = 'djangocms_stories:post-detail'
instant_article = False
get(request, *args, **kwargs)[source]

Make toolbar object’s apphook config available

get_template_names()[source]

Return a list of template names to be used for the request. May not be called if render_to_response() is overridden. Return a list containing template_name, if set on the value. Otherwise, return a list containing:

  • the contents of the template_name_field field on the object instance that the view is operating upon (if available)

  • <app_label>/<model_name><template_name_suffix>.html

get_object()[source]

Return the object the view is displaying.

Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.

get_context_data(**kwargs)[source]

Insert the single object into the context dict.

Archive Views

PostArchiveView

class PostArchiveView(**kwargs)[source]

Bases: BaseConfigListViewMixin, ListView

model

alias of PostContent

context_object_name = 'postcontent_list'
base_template_name = 'post_list.html'
date_field = 'date_published'
allow_empty = True
allow_future = True
view_url_name = 'djangocms_stories:posts-archive'
get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

get_context_data(**kwargs)[source]

Get the context for this view.

PostYearArchiveView

PostMonthArchiveView

PostDayArchiveView

Mixins

AppConfigMixin

BaseMixin