Home | Trees | Indices | Help |
|
---|
|
1 """Views for Zinnia categories""" 2 from django.shortcuts import get_object_or_404 3 from django.views.generic.list_detail import object_list 4 5 from zinnia.models import Category 6 from zinnia.settings import PAGINATION 7 810 """Retrieve a Category by a path""" 11 path_bits = [p for p in path.split('/') if p] 12 return get_object_or_404(Category, slug=path_bits[-1])13 1416 """Display the entries of a category""" 17 category = get_category_or_404(path) 18 19 return object_list(request, queryset=category.entries_published_set(), 20 paginate_by=PAGINATION, page=page, 21 extra_context={'category': category})22
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Feb 22 09:38:54 2011 | http://epydoc.sourceforge.net |