Mercurial > public > sg101
view contests/urls.py @ 1064:f0ac48aa8c64
Fix bug where None could be saved as html field.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 30 Mar 2016 19:59:11 -0500 |
parents | 5ba2508939f7 |
children | 16e190fa6ef8 |
line wrap: on
line source
""" Url patterns for the contests application. """ from django.conf.urls import url from django.views.generic import DetailView, ListView from contests.models import Contest import contests.views urlpatterns = [ url(r'^$', ListView.as_view( context_object_name='contests', queryset=Contest.public_objects.all().prefetch_related('winners')), name='contests-index'), url(r'^enter/$', contests.views.enter, name='contests-enter'), url(r'^c/(?P<slug>[\w-]+)/$', DetailView.as_view( context_object_name='contest', queryset=Contest.public_objects.all().prefetch_related('winners')), name='contests-contest'), ]