-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Corey Oordt
committed
Aug 27, 2009
1 parent
13154fd
commit 603352c
Showing
4 changed files
with
0 additions
and
266 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +0,0 @@ | ||
from django.shortcuts import get_object_or_404, render_to_response | ||
from django.template import RequestContext | ||
from categories.models import Category | ||
from stories.models import Story | ||
from django.db.models import Q | ||
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 | ||
|
||
if with_stories: | ||
stories = Story.published.filter(Q(primary_category=category) | Q(categories__in=[category,])) | ||
context['stories'] = stories | ||
|
||
return render_to_response(template_name, | ||
context, | ||
context_instance=RequestContext(request) | ||
) | ||