comparison videos/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 e2868ad47a1e
children
comparison
equal deleted inserted replaced
179:574cdd0241af 180:312f198e8958
1 """ 1 """
2 Urls for the videos application. 2 Urls for the videos 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 DetailView, ListView 6 from django.views.generic import DetailView, ListView
7 7
8 from videos.models import Collection 8 from videos.models import Collection
9 9
10 10
11 urlpatterns = patterns('', 11 urlpatterns = [
12 url(r'^$', 12 url(r'^$',
13 ListView.as_view( 13 ListView.as_view(
14 model=Collection, 14 model=Collection,
15 context_object_name='collection_list'), 15 context_object_name='collection_list'),
16 name='videos-index'), 16 name='videos-index'),
17 url(r'^(?P<pk>\d+)/$', 17 url(r'^(?P<pk>\d+)/$',
18 DetailView.as_view(model=Collection, context_object_name='collection'), 18 DetailView.as_view(model=Collection, context_object_name='collection'),
19 name='videos-item') 19 name='videos-item')
20 ) 20 ]