annotate contests/urls.py @ 1054:5b8062cce722

Top-bar search is working. A few small visual tweaks.
author Brian Neal <bgneal@gmail.com>
date Mon, 07 Mar 2016 19:55:26 -0600
parents 5ba2508939f7
children 16e190fa6ef8
rev   line source
bgneal@540 1 """
bgneal@540 2 Url patterns for the contests application.
bgneal@540 3
bgneal@540 4 """
bgneal@1028 5 from django.conf.urls import url
bgneal@540 6 from django.views.generic import DetailView, ListView
bgneal@540 7
bgneal@540 8 from contests.models import Contest
bgneal@1028 9 import contests.views
bgneal@540 10
bgneal@540 11
bgneal@1028 12 urlpatterns = [
bgneal@540 13 url(r'^$',
bgneal@540 14 ListView.as_view(
bgneal@540 15 context_object_name='contests',
bgneal@796 16 queryset=Contest.public_objects.all().prefetch_related('winners')),
bgneal@540 17 name='contests-index'),
bgneal@540 18
bgneal@540 19 url(r'^enter/$',
bgneal@1028 20 contests.views.enter,
bgneal@540 21 name='contests-enter'),
bgneal@540 22
bgneal@540 23 url(r'^c/(?P<slug>[\w-]+)/$',
bgneal@540 24 DetailView.as_view(
bgneal@540 25 context_object_name='contest',
bgneal@796 26 queryset=Contest.public_objects.all().prefetch_related('winners')),
bgneal@540 27 name='contests-contest'),
bgneal@1028 28 ]