diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-04-22 00:36:57 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-04-22 00:36:57 -0400 |
commit | df7a6aa620af6a165bdacd755757f8cb1179331c (patch) | |
tree | 384b4c62d1f50d8effb733d81d2a810666807624 /news/urls.py | |
parent | 94f972bb892dbf9a86f089f1872ae6d849c0cd0e (diff) | |
parent | a22557811a24b68ef85d4271787c48d8d1e4fc99 (diff) |
Merge branch 'archweb-generic2'
Conflicts:
README.BRANDING
local_settings.py.example
packages/templatetags/package_extras.py
public/views.py
releng/views.py
settings.py
sitestatic/archnavbar/archnavbar.css
sitestatic/silhouette.png
templates/base.html
templates/packages/differences.html
templates/packages/opensearch.xml
templates/packages/search.html
templates/public/donate.html
templates/public/download.html
templates/public/feeds.html
templates/public/index.html
urls.py
Diffstat (limited to 'news/urls.py')
-rw-r--r-- | news/urls.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/news/urls.py b/news/urls.py index 10020f31..0eec6d86 100644 --- a/news/urls.py +++ b/news/urls.py @@ -1,14 +1,25 @@ from django.conf.urls import patterns +from django.contrib.auth.decorators import permission_required +from .views import (NewsDetailView, NewsListView, + NewsCreateView, NewsEditView, NewsDeleteView) + urlpatterns = patterns('news.views', - (r'^$', 'news_list', {}, 'news-list'), - (r'^add/$', 'add'), - (r'^preview/$', 'preview'), + (r'^$', + NewsListView.as_view(), {}, 'news-list'), + + (r'^preview/$', 'preview'), # old news URLs, permanent redirect view so we don't break all links - (r'^(?P<object_id>\d+)/$', 'view_redirect'), - (r'^(?P<slug>[-\w]+)/$', 'view'), - (r'^(?P<slug>[-\w]+)/edit/$', 'edit'), - (r'^(?P<slug>[-\w]+)/delete/$', 'delete'), + (r'^(?P<object_id>\d+)/$', 'view_redirect'), + + (r'^add/$', + permission_required('news.add_news')(NewsCreateView.as_view())), + (r'^(?P<slug>[-\w]+)/$', + NewsDetailView.as_view()), + (r'^(?P<slug>[-\w]+)/edit/$', + permission_required('news.change_news')(NewsEditView.as_view())), + (r'^(?P<slug>[-\w]+)/delete/$', + permission_required('news.delete_news')(NewsDeleteView.as_view())), ) # vim: set ts=4 sw=4 et: |