mirror of
https://github.com/jazzband/django-categories.git
synced 2026-05-20 05:11:53 +00:00
added views
This commit is contained in:
parent
2e9cba224c
commit
c3b26df0da
1 changed files with 17 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
from django.shortcuts import get_object_or_404, render_to_response
|
||||
from django.template import RequestContext
|
||||
from categories.models import Category
|
||||
from django.views.decorators.cache import cache_page
|
||||
|
||||
def category_detail(request, slug, with_stories=False,
|
||||
template_name='categories/category_detail.html'):
|
||||
context = {}
|
||||
category = get_object_or_404(Category,
|
||||
slug__iexact=slug)
|
||||
|
||||
context['category'] = category
|
||||
|
||||
return render_to_response(template_name,
|
||||
context,
|
||||
context_instance=RequestContext(request)
|
||||
)
|
||||
Loading…
Reference in a new issue