Mercurial > public > madeira
comparison articles/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 articles application. | 2 Urls for the articles 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 articles.models import Article | 8 from articles.models import Article |
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=Article, | 14 model=Article, |
15 context_object_name='article_list'), | 15 context_object_name='article_list'), |
16 name='articles-index'), | 16 name='articles-index'), |
17 url(r'^(?P<pk>\d+)/$', | 17 url(r'^(?P<pk>\d+)/$', |
18 DetailView.as_view(model=Article, context_object_name='article'), | 18 DetailView.as_view(model=Article, context_object_name='article'), |
19 name='articles-item') | 19 name='articles-item') |
20 ) | 20 ] |