comparison contests/urls.py @ 796:5977b43499f7

Modified contests to have multiple winners.
author Brian Neal <bgneal@gmail.com>
date Fri, 04 Jul 2014 20:30:14 -0500
parents ee87ea74d46b
children 5ba2508939f7
comparison
equal deleted inserted replaced
795:5d48fd80f27d 796:5977b43499f7
10 10
11 urlpatterns = patterns('', 11 urlpatterns = patterns('',
12 url(r'^$', 12 url(r'^$',
13 ListView.as_view( 13 ListView.as_view(
14 context_object_name='contests', 14 context_object_name='contests',
15 queryset=Contest.public_objects.select_related('winner')), 15 queryset=Contest.public_objects.all().prefetch_related('winners')),
16 name='contests-index'), 16 name='contests-index'),
17 17
18 url(r'^enter/$', 18 url(r'^enter/$',
19 'contests.views.enter', 19 'contests.views.enter',
20 name='contests-enter'), 20 name='contests-enter'),
21 21
22 url(r'^c/(?P<slug>[\w-]+)/$', 22 url(r'^c/(?P<slug>[\w-]+)/$',
23 DetailView.as_view( 23 DetailView.as_view(
24 context_object_name='contest', 24 context_object_name='contest',
25 queryset=Contest.public_objects.all().select_related('winner')), 25 queryset=Contest.public_objects.all().prefetch_related('winners')),
26 name='contests-contest'), 26 name='contests-contest'),
27 ) 27 )