1
"""Views for Zinnia authors"""
2
from django.shortcuts import get_object_or_404
3
from django.views.generic.list_detail import object_list
5
from zinnia.models import Author
6
from zinnia.settings import PAGINATION
7
from zinnia.views.decorators import update_queryset
10
author_list = update_queryset(object_list, Author.published.all)
13
def author_detail(request, username, page=None):
14
"""Display the entries of an author"""
15
author = get_object_or_404(Author, username=username)
16
return object_list(request, queryset=author.entries_published_set(),
17
paginate_by=PAGINATION, page=page,
18
extra_context={'author': author})