diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-20 16:10:09 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-21 09:10:02 -0500 |
commit | 41dc37c8126f062257ce7d5fc8fcf84286b55a88 (patch) | |
tree | c73e8f661ffb68d036f528257148243036b28a82 /urls.py | |
parent | 7c92ddbd3c86d6aaa34abd4b2d3f12775801b50b (diff) |
Update news views to use slug instead of ID
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'urls.py')
-rw-r--r-- | urls.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -62,12 +62,14 @@ urlpatterns = patterns('', (r'^todo/$', 'todolists.views.list'), (r'^todolists/$', 'todolists.views.public_list'), - (r'^news/(\d+)/$', 'news.views.view'), - (r'^news/add/$', 'news.views.add'), - (r'^news/edit/(\d+)/$', 'news.views.edit'), - (r'^news/delete/(\d+)/$', 'news.views.delete'), - (r'^news/preview/$', 'news.views.preview'), - (r'^news/$', 'news.views.list', {}, 'news-list'), + (r'^news/add/$', 'news.views.add'), + (r'^news/preview/$', 'news.views.preview'), + # old news URLs, permanent redirect view so we don't break all links + (r'^news/(?P<object_id>\d+)/$', 'news.views.view_redirect'), + (r'^news/(?P<slug>[-\w]+)/$', 'news.views.view'), + (r'^news/(?P<slug>[-\w]+)/edit/$', 'news.views.edit'), + (r'^news/(?P<slug>[-\w]+)/delete/$', 'news.views.delete'), + (r'^news/$', 'news.views.list', {}, 'news-list'), (r'^mirrors/$', 'devel.views.mirrorlist', {}, 'mirrors-list'), |