diff options
Diffstat (limited to 'app/birds/views.py')
-rw-r--r-- | app/birds/views.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/birds/views.py b/app/birds/views.py new file mode 100644 index 0000000..bd2f79e --- /dev/null +++ b/app/birds/views.py @@ -0,0 +1,27 @@ +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)) + |