Mercurial > public > sg101
comparison gpp/contests/urls.py @ 540:51fa1e0ca218
For #243, create a contests application.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 09 Jan 2012 01:13:08 +0000 |
parents | |
children | 0a8e6a9ccf53 |
comparison
equal
deleted
inserted
replaced
539:2f0a372c92b4 | 540:51fa1e0ca218 |
---|---|
1 """ | |
2 Url patterns for the contests application. | |
3 | |
4 """ | |
5 from django.conf.urls.defaults import patterns, url | |
6 from django.views.generic import DetailView, ListView | |
7 | |
8 from contests.models import Contest | |
9 | |
10 | |
11 urlpatterns = patterns('', | |
12 url(r'^$', | |
13 ListView.as_view( | |
14 context_object_name='contests', | |
15 queryset=Contest.public_objects.all()), | |
16 name='contests-index'), | |
17 | |
18 url(r'^enter/$', | |
19 'contests.views.enter', | |
20 name='contests-enter'), | |
21 | |
22 url(r'^c/(?P<slug>[\w-]+)/$', | |
23 DetailView.as_view( | |
24 context_object_name='contest', | |
25 queryset=Contest.public_objects.all().select_related('winner')), | |
26 name='contests-contest'), | |
27 ) |