summaryrefslogtreecommitdiff
path: root/urls.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-09-20 16:10:09 -0500
committerDan McGee <dan@archlinux.org>2010-09-21 09:10:02 -0500
commit41dc37c8126f062257ce7d5fc8fcf84286b55a88 (patch)
treec73e8f661ffb68d036f528257148243036b28a82 /urls.py
parent7c92ddbd3c86d6aaa34abd4b2d3f12775801b50b (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.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/urls.py b/urls.py
index 3f394426..5ff57970 100644
--- a/urls.py
+++ b/urls.py
@@ -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'),