summaryrefslogtreecommitdiff
path: root/app/src/views.py
blob: ceba07936929965f6616ae12b47036c3fa508703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from .models import Entry, Topic


def topic(request, slug):
    obj = get_object_or_404(Topic, slug__exact=slug)
    qs = Entry.objects.filter(topics__slug=slug).order_by('-pub_date')
    return render_to_response('archives/src_home.html', {'object_list': qs, 'topic':obj}, context_instance=RequestContext(request))


def detail(request, slug):
    obj = get_object_or_404(Entry, slug__exact=slug)
    return render_to_response('details/src_entry.html', {'object': obj}, context_instance=RequestContext(request))