bgneal@540: """ bgneal@540: Url patterns for the contests application. bgneal@540: bgneal@540: """ bgneal@574: from django.conf.urls import patterns, url bgneal@540: from django.views.generic import DetailView, ListView bgneal@540: bgneal@540: from contests.models import Contest bgneal@540: bgneal@540: bgneal@540: urlpatterns = patterns('', bgneal@540: url(r'^$', bgneal@540: ListView.as_view( bgneal@540: context_object_name='contests', bgneal@796: queryset=Contest.public_objects.all().prefetch_related('winners')), bgneal@540: name='contests-index'), bgneal@540: bgneal@540: url(r'^enter/$', bgneal@540: 'contests.views.enter', bgneal@540: name='contests-enter'), bgneal@540: bgneal@540: url(r'^c/(?P[\w-]+)/$', bgneal@540: DetailView.as_view( bgneal@540: context_object_name='contest', bgneal@796: queryset=Contest.public_objects.all().prefetch_related('winners')), bgneal@540: name='contests-contest'), bgneal@540: )