bgneal@540: """
bgneal@540: Url patterns for the contests application.
bgneal@540: 
bgneal@540: """
bgneal@1028: from django.conf.urls import url
bgneal@540: from django.views.generic import DetailView, ListView
bgneal@540: 
bgneal@540: from contests.models import Contest
bgneal@1028: import contests.views
bgneal@540: 
bgneal@540: 
bgneal@1028: urlpatterns = [
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@1028:        contests.views.enter,
bgneal@540:        name='contests-enter'),
bgneal@540: 
bgneal@540:    url(r'^c/(?P<slug>[\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@1028: ]