diff options
author | Dan McGee <dan@archlinux.org> | 2012-03-29 10:00:11 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-03-29 10:00:11 -0500 |
commit | 076f9c51d50be9bb567e8477eff4c15bde62fcb3 (patch) | |
tree | 9075731fcf1fefb54b6920e18bf6db70a7d86dfa /packages | |
parent | fd53e0248fdefc4d49fdb739767c496d42396c5e (diff) |
Return files in default order
When we read the repository databases, we get a filelist in sorted
order. Save time by returning the file list in that order rather than
resorting it based on filename and directory.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/views/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/views/__init__.py b/packages/views/__init__.py index afb1de31..2798fff1 100644 --- a/packages/views/__init__.py +++ b/packages/views/__init__.py @@ -185,7 +185,8 @@ def group_details(request, arch, name): def files(request, name, repo, arch): pkg = get_object_or_404(Package, pkgname=name, repo__name__iexact=repo, arch__name=arch) - fileslist = PackageFile.objects.filter(pkg=pkg).order_by('directory', 'filename') + # files are inserted in sorted order, so preserve that + fileslist = PackageFile.objects.filter(pkg=pkg).order_by('id') dir_count = sum(1 for f in fileslist if f.is_directory) files_count = len(fileslist) - dir_count context = { @@ -209,7 +210,8 @@ def details_json(request, name, repo, arch): def files_json(request, name, repo, arch): pkg = get_object_or_404(Package, pkgname=name, repo__name__iexact=repo, arch__name=arch) - fileslist = PackageFile.objects.filter(pkg=pkg).order_by('directory', 'filename') + # files are inserted in sorted order, so preserve that + fileslist = PackageFile.objects.filter(pkg=pkg).order_by('id') data = { 'pkgname': pkg.pkgname, 'repo': pkg.repo.name.lower(), |