from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.http import Http404 from django.conf import settings # from django.views.generic import ListView from birds.models import Bird, BirdAudio, BirdSighting from locations.models import Region, Country def bird_list(request, user): #request.page_url = '/birds/seen/%d/' #request.page = int(page) context = { 'object_list': BirdSighting.objects.filter(seen_by__username=user), 'user': user, } return render_to_response("archives/birds.html", context, context_instance=RequestContext(request)) def bird_detail(request, slug): context = { 'object': Bird.objects.get(slug=slug), 'recording': BirdAudio.objects.get(bird__slug=slug) } return render_to_response("details/bird.html", context, context_instance=RequestContext(request))