Mercurial > public > sg101
comparison contests/urls.py @ 581:ee87ea74d46b
For Django 1.4, rearranged project structure for new manage.py.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 05 May 2012 17:10:48 -0500 |
parents | gpp/contests/urls.py@ddd69a8e07c7 |
children | 5977b43499f7 |
comparison
equal
deleted
inserted
replaced
580:c525f3e0b5d0 | 581:ee87ea74d46b |
---|---|
1 """ | |
2 Url patterns for the contests application. | |
3 | |
4 """ | |
5 from django.conf.urls 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.select_related('winner')), | |
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 ) |