view potd/views.py @ 1051:68a7482d1cea

Removed logo/link to surfrockmusic.com :(
author Brian Neal <bgneal@gmail.com>
date Wed, 02 Mar 2016 18:23:48 -0600
parents e932f2ecd4a7
children 977e76f7f736
line wrap: on
line source
"""
Views for the POTD application.
"""

from django.shortcuts import render
from django.shortcuts import get_object_or_404

from potd.models import Current
from potd.models import Photo


def view(request):
    potd = Current.objects.get_current_photo()
    return render(request, 'potd/view.html', {
        'potd': potd,
        'is_current': True,
        })


def archive(request, id):
    photo = get_object_or_404(Photo, pk=id)
    return render(request, 'potd/view.html', {
        'potd': photo,
        'is_current': False,
        })