blog.views

Classes

BlogArhiveView(**kwargs) Displays the blog archive by years and months
BlogCategoriesListView(**kwargs) Displays the list of categories that have posts in them
BlogCategoryView(**kwargs) Displays the list of posts in a given category
BlogFeaturedPostsView(**kwargs) Displays the list of featured posts
BlogHomeView(**kwargs) Displays the list of all published posts starting from the recent.
BlogMonthArchiveView(**kwargs) Displays the list of posts by year and month
BlogPostSearchView(**kwargs) Displays the search page
BlogPostView(**kwargs) Displays a blog post page
class blog.views.BlogHomeView(**kwargs)[source]

Bases: blog.views._PostsListView

Displays the list of all published posts starting from the recent.

Template: blog_posts_list.html

Specific context variable: posts

class blog.views.BlogFeaturedPostsView(**kwargs)[source]

Bases: blog.views._PageTitleMixIn, blog.views._PostsListView

Displays the list of featured posts

Template: blog_posts_list.html

Specific context variables:

  • posts
  • page_title
class blog.views.BlogCategoryView(**kwargs)[source]

Bases: blog.views._PageTitleMixIn, blog.views._PostsListView

Displays the list of posts in a given category

Template: blog_posts_list.html

Specific context variables:

  • posts
  • page_title
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.

class blog.views.BlogCategoriesListView(**kwargs)[source]

Bases: blog.views._PageTitleMixIn, django.views.generic.list.ListView

Displays the list of categories that have posts in them

Template: blog_categories_list.html

Specific context variables:

  • categories
  • page_title
class blog.views.BlogPostView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

Displays a blog post page

Template: blog_post.html

Specific context variable: post

model

alias of blog.models.Post

get_object(queryset=None)[source]

Prevent non-authenticated users from viewing unpublished posts

class blog.views.BlogArhiveView(**kwargs)[source]

Bases: blog.views._PageTitleMixIn, django.views.generic.list.ListView

Displays the blog archive by years and months

Template: blog_archive.html

Specific context variables:

  • months – the list of class:datetime.data objects representing months
  • page_title
class blog.views.BlogMonthArchiveView(**kwargs)[source]

Bases: blog.views._PageTitleMixIn, blog.views._PostsListView

Displays the list of posts by year and month

Template: blog_posts_list.html

Specific context variables:

  • posts
  • page_title
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.

class blog.views.BlogPostSearchView(**kwargs)[source]

Bases: haystack.generic_views.SearchView

Displays the search page

Template: blog_search.html

Specific context variables: none.

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.