summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-12-13 15:27:59 -0600
committerDan McGee <dan@archlinux.org>2010-12-13 15:28:47 -0600
commit61f24b4bd9e0c533f054e9ba3f12a24ab405897f (patch)
treeba7c00f9e82104398791e5f8225ec005609d84f0
parent6e3dc1be01ac0e5d0fb08142abfc1417eb924871 (diff)
Refactor packages urls for clean look
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--packages/urls.py26
1 files 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 @@ urlpatterns = patterns('packages.views',
'details'),
(r'^(?P<repo>[A-z0-9\-]+)/(?P<name>[A-z0-9\-+.]+)/$',
'details'),
- (r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/$',
- 'details'),
- (r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/files/$',
- 'files'),
- (r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/maintainer/$',
- 'getmaintainer'),
- (r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/flag/$',
- 'flag'),
- (r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/unflag/$',
- 'unflag'),
- (r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/download/$',
- 'download'),
+ # canonical package url. subviews defined above
+ (r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/',
+ include(package_patterns)),
)
# vim: set ts=4 sw=4 et: