summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/views.py9
-rw-r--r--urls.py3
2 files changed, 7 insertions, 5 deletions
diff --git a/packages/views.py b/packages/views.py
index 97929ed3..acd71b2d 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -60,7 +60,7 @@ def update(request):
def details(request, name='', repo='', arch=''):
if all([name, repo, arch]):
- pkg= get_object_or_404(Package,
+ pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
return render_to_response('packages/details.html', RequestContext(
request, {'pkg': pkg, }))
@@ -178,9 +178,10 @@ def search(request, page=None):
template_object_name="package",
extra_context=page_dict)
-def files(request, pkgid):
- pkg = get_object_or_404(Package, id=pkgid)
- files = PackageFile.objects.filter(pkg=pkgid)
+def files(request, name='', repo='', arch=''):
+ pkg = get_object_or_404(Package,
+ pkgname=name, repo__name__iexact=repo, arch__name=arch)
+ files = PackageFile.objects.filter(pkg=pkg)
return render_to_response('packages/files.html', RequestContext(request, {'pkg':pkg,'files':files}))
@permission_required('main.change_package')
diff --git a/urls.py b/urls.py
index ec04edce..e53d918a 100644
--- a/urls.py
+++ b/urls.py
@@ -27,7 +27,6 @@ urlpatterns = patterns('',
(r'^packages/flag/(\d+)/$', 'packages.views.flag'),
(r'^packages/flaghelp/$', 'packages.views.flaghelp'),
(r'^packages/unflag/(\d+)/$', 'packages.views.unflag'),
- (r'^packages/files/(\d+)/$', 'packages.views.files'),
(r'^packages/signoffs/$', 'packages.views.signoffs'),
(r'^packages/signoff_package/(?P<arch>[A-z0-9]+)/(?P<pkgname>[A-z0-9\-+.]+)/$',
'packages.views.signoff_package'),
@@ -46,6 +45,8 @@ urlpatterns = patterns('',
'packages.views.details'),
(r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/$',
'packages.views.details'),
+ (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/files/$',
+ 'packages.views.files'),
(r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/maintainer/$',
'packages.views.getmaintainer'),