bgneal@540: """ bgneal@540: Url patterns for the contests application. bgneal@540: bgneal@540: """ bgneal@540: from django.conf.urls.defaults 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@567: queryset=Contest.public_objects.select_related('winner')), 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@540: queryset=Contest.public_objects.all().select_related('winner')), bgneal@540: name='contests-contest'), bgneal@540: )