From 33d3159145359df7638b3ac0268d4a400856a932 Mon Sep 17 00:00:00 2001 From: zuber Date: Thu, 20 Aug 2009 12:15:19 +0200 Subject: [PATCH] =?utf8?q?Sortowanie=20listy=20plik=C3=B3w=20i=20folder?= =?utf8?q?=C3=B3w=20w=20get=5Fimage=5Ffolders=20i=20get=5Fimages=5Ffrom=5F?= =?utf8?q?folder.=20Refs=20#56.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- apps/explorer/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/explorer/models.py b/apps/explorer/models.py index 5fa93ad6..1f8e93dc 100644 --- a/apps/explorer/models.py +++ b/apps/explorer/models.py @@ -4,11 +4,11 @@ from django.conf import settings def get_image_folders(): - return [fn for fn in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR)) if not fn.startswith('.')] + return sorted(fn for fn in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR)) if not fn.startswith('.')) def get_images_from_folder(folder): - return [settings.MEDIA_URL + settings.IMAGE_DIR + '/' + folder + '/' + fn for fn + return sorted(settings.MEDIA_URL + settings.IMAGE_DIR + '/' + folder + '/' + fn for fn in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, folder)) - if not fn.startswith('.')] + if not fn.startswith('.')) -- 2.20.1