dr.botzo/races/views.py
Brian S. Stephan 54b6da689d Races: really basic races site with a detail page
getting this out there so that i maybe feel motivated to make it not
suck in the future
2014-03-20 19:21:56 -05:00

22 lines
485 B
Python

from django.shortcuts import get_object_or_404, render
from races.models import Race, Racer, RaceUpdate
def index(request):
"""Display a list of races."""
races = Race.objects.all()
return render(request, 'races/index.html', {'races': races})
def race_detail(request, race_id):
"""Display a race detail."""
race = get_object_or_404(Race, pk=race_id)
return render(request, 'races/race_detail.html', {'race': race})
# vi:tabstop=4:expandtab:autoindent