From 61f24b4bd9e0c533f054e9ba3f12a24ab405897f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 13 Dec 2010 15:27:59 -0600 Subject: Refactor packages urls for clean look Signed-off-by: Dan McGee --- packages/urls.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/urls.py b/packages/urls.py index b3927677..da24ee03 100644 --- a/packages/urls.py +++ b/packages/urls.py @@ -1,4 +1,13 @@ -from django.conf.urls.defaults import patterns +from django.conf.urls.defaults import include, patterns + +package_patterns = patterns('packages.views', + (r'^$', 'details'), + (r'^files/$', 'files'), + (r'^maintainer/$', 'getmaintainer'), + (r'^flag/$', 'flag'), + (r'^unflag/$', 'unflag'), + (r'^download/$', 'download'), +) urlpatterns = patterns('packages.views', (r'^flaghelp/$', 'flaghelp'), @@ -20,18 +29,9 @@ 'details'), (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9\-+.]+)/$', 'details'), - (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9]+)/(?P[A-z0-9\-+.]+)/$', - 'details'), - (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9]+)/(?P[A-z0-9\-+.]+)/files/$', - 'files'), - (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9]+)/(?P[A-z0-9\-+.]+)/maintainer/$', - 'getmaintainer'), - (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9]+)/(?P[A-z0-9\-+.]+)/flag/$', - 'flag'), - (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9]+)/(?P[A-z0-9\-+.]+)/unflag/$', - 'unflag'), - (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9]+)/(?P[A-z0-9\-+.]+)/download/$', - 'download'), + # canonical package url. subviews defined above + (r'^(?P[A-z0-9\-]+)/(?P[A-z0-9]+)/(?P[A-z0-9\-+.]+)/', + include(package_patterns)), ) # vim: set ts=4 sw=4 et: -- cgit v1.2.3-54-g00ecf