Mercurial > public > sg101
view gpp/contests/urls.py @ 567:0a8e6a9ccf53
Tweaks to the contests application: show the winners on the list page.
Minor presentation changes on the detail template.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 07 Mar 2012 18:12:02 -0600 |
parents | 51fa1e0ca218 |
children | ddd69a8e07c7 |
line wrap: on
line source
""" Url patterns for the contests application. """ from django.conf.urls.defaults import patterns, url from django.views.generic import DetailView, ListView from contests.models import Contest urlpatterns = patterns('', url(r'^$', ListView.as_view( context_object_name='contests', queryset=Contest.public_objects.select_related('winner')), name='contests-index'), url(r'^enter/$', 'contests.views.enter', name='contests-enter'), url(r'^c/(?P<slug>[\w-]+)/$', DetailView.as_view( context_object_name='contest', queryset=Contest.public_objects.all().select_related('winner')), name='contests-contest'), )