gremmie@1: """
gremmie@1: Views for the POTD application.
gremmie@1: """
gremmie@1: 
gremmie@1: from django.shortcuts import render_to_response
bgneal@14: from django.shortcuts import get_object_or_404
gremmie@1: from django.template import RequestContext
gremmie@1: 
gremmie@1: from potd.models import Current
bgneal@14: from potd.models import Photo
gremmie@1: 
gremmie@1: 
gremmie@1: def view(request):
gremmie@1:     potd = Current.objects.get_current_photo()
gremmie@1:     return render_to_response('potd/view.html', {
gremmie@1:         'potd': potd,
bgneal@14:         'is_current': True,
gremmie@1:         },
gremmie@1:         context_instance = RequestContext(request))
bgneal@14: 
bgneal@14: def archive(request, id):
bgneal@14:     photo = get_object_or_404(Photo, pk=id)
bgneal@14:     return render_to_response('potd/view.html', {
bgneal@14:         'potd': photo,
bgneal@14:         'is_current': False,
bgneal@14:         },
bgneal@14:         context_instance = RequestContext(request))