diff options
Diffstat (limited to 'todolists/urls.py')
-rw-r--r-- | todolists/urls.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/todolists/urls.py b/todolists/urls.py index 81ac11f5..cbc9547e 100644 --- a/todolists/urls.py +++ b/todolists/urls.py @@ -1,17 +1,26 @@ from django.conf.urls import patterns -from django.contrib.auth.decorators import permission_required +from django.contrib.auth.decorators import login_required, permission_required -from .views import DeleteTodolist +from .views import (view_redirect, view, todolist_list, add, edit, flag, + list_pkgbases, DeleteTodolist) -urlpatterns = patterns('todolists.views', - (r'^$', 'todolist_list'), - (r'^(?P<list_id>\d+)/$', 'view'), - (r'^(?P<list_id>\d+)/pkgbases/(?P<svn_root>[a-z]+)/$', 'list_pkgbases'), - (r'^add/$', 'add'), - (r'^edit/(?P<list_id>\d+)/$', 'edit'), - (r'^flag/(\d+)/(\d+)/$', 'flag'), - (r'^delete/(?P<pk>\d+)/$', +urlpatterns = patterns('', + (r'^$', login_required(todolist_list)), + + # old todolists URLs, permanent redirect view so we don't break all links + (r'^(?P<old_id>\d+)/$', view_redirect), + + (r'^add/$', + permission_required('todolists.add_todolist')(add)), + (r'^(?P<slug>[-\w]+)/$', login_required(view)), + (r'^(?P<slug>[-\w]+)/edit/$', + permission_required('todolists.change_todolist')(edit)), + (r'^(?P<slug>[-\w]+)/delete/$', permission_required('todolists.delete_todolist')(DeleteTodolist.as_view())), + (r'^(?P<slug>[-\w]+)/flag/(?P<pkg_id>\d+)/$', + permission_required('todolists.change_todolistpackage')(flag)), + (r'^(?P<slug>[-\w]+)/pkgbases/(?P<svn_root>[a-z]+)/$', + 'list_pkgbases'), ) # vim: set ts=4 sw=4 et: |