Mercurial > public > sg101
annotate contests/urls.py @ 1046:61abc6f6530c
Merge with upstream.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 07 Feb 2016 20:44:03 -0600 |
parents | 5ba2508939f7 |
children | 16e190fa6ef8 |
rev | line source |
---|---|
bgneal@540 | 1 """ |
bgneal@540 | 2 Url patterns for the contests application. |
bgneal@540 | 3 |
bgneal@540 | 4 """ |
bgneal@1028 | 5 from django.conf.urls import url |
bgneal@540 | 6 from django.views.generic import DetailView, ListView |
bgneal@540 | 7 |
bgneal@540 | 8 from contests.models import Contest |
bgneal@1028 | 9 import contests.views |
bgneal@540 | 10 |
bgneal@540 | 11 |
bgneal@1028 | 12 urlpatterns = [ |
bgneal@540 | 13 url(r'^$', |
bgneal@540 | 14 ListView.as_view( |
bgneal@540 | 15 context_object_name='contests', |
bgneal@796 | 16 queryset=Contest.public_objects.all().prefetch_related('winners')), |
bgneal@540 | 17 name='contests-index'), |
bgneal@540 | 18 |
bgneal@540 | 19 url(r'^enter/$', |
bgneal@1028 | 20 contests.views.enter, |
bgneal@540 | 21 name='contests-enter'), |
bgneal@540 | 22 |
bgneal@540 | 23 url(r'^c/(?P<slug>[\w-]+)/$', |
bgneal@540 | 24 DetailView.as_view( |
bgneal@540 | 25 context_object_name='contest', |
bgneal@796 | 26 queryset=Contest.public_objects.all().prefetch_related('winners')), |
bgneal@540 | 27 name='contests-contest'), |
bgneal@1028 | 28 ] |