Mercurial > public > sg101
diff 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 |
line wrap: on
line diff
--- a/contests/urls.py Fri Jun 06 18:28:28 2014 -0500 +++ b/contests/urls.py Fri Jul 04 20:30:14 2014 -0500 @@ -12,7 +12,7 @@ url(r'^$', ListView.as_view( context_object_name='contests', - queryset=Contest.public_objects.select_related('winner')), + queryset=Contest.public_objects.all().prefetch_related('winners')), name='contests-index'), url(r'^enter/$', @@ -22,6 +22,6 @@ url(r'^c/(?P<slug>[\w-]+)/$', DetailView.as_view( context_object_name='contest', - queryset=Contest.public_objects.all().select_related('winner')), + queryset=Contest.public_objects.all().prefetch_related('winners')), name='contests-contest'), )