view potd/views.py @ 1160:b84ce2d7e93d

New template for displaying django messages. New common template for rendering django messages in the new V3 Foundation style.
author Brian Neal <bgneal@gmail.com>
date Tue, 24 Jan 2017 19:22:29 -0600
parents 977e76f7f736
children
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,
        'V3_DESIGN': True,
        })


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