comparison gigs/urls.py @ 180:312f198e8958

Changes for Django 1.8.
author Brian Neal <bgneal@gmail.com>
date Sun, 13 Dec 2015 21:04:43 -0600
parents 23efa49f5e29
children
comparison
equal deleted inserted replaced
179:574cdd0241af 180:312f198e8958
1 """ 1 """
2 Urls for the gigs application. 2 Urls for the gigs application.
3 3
4 """ 4 """
5 from django.conf.urls import patterns, url 5 from django.conf.urls import url
6 from django.views.generic import ListView 6 from django.views.generic import ListView
7 7
8 from gigs.models import Gig 8 from gigs.models import Gig
9 import gigs.views
9 10
10 11
11 urlpatterns = patterns('', 12 urlpatterns = [
12 url(r'^$', 'gigs.views.gigs', name='gigs-index'), 13 url(r'^$', gigs.views.gigs, name='gigs-index'),
13 url(r'^flyers/$', 14 url(r'^flyers/$',
14 ListView.as_view( 15 ListView.as_view(
15 queryset=Gig.objects.exclude(flyer__isnull=True).select_related('flyer'), 16 queryset=Gig.objects.exclude(flyer__isnull=True).select_related('flyer'),
16 template_name='gigs/flyers.html', 17 template_name='gigs/flyers.html',
17 paginate_by=10, 18 paginate_by=10,
18 context_object_name='gig_list'), 19 context_object_name='gig_list'),
19 name='gigs-flyers') 20 name='gigs-flyers')
20 ) 21 ]