From a0cd93c1d528fbb1c5919fed0a52b09bbe84933d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 11 Feb 2010 22:15:13 -0600 Subject: Bring package files view up to speed Move it away from the numeric pkgid-based view of old to the new pretty URL format. This does nothing to actually make the view show files (or even provide a link to it), but that will come in future commits. Signed-off-by: Dan McGee --- packages/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/views.py') 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') -- cgit v1.2.3-54-g00ecf