X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d154270c884fe196fb56fa3123183c3408a45ecc..3d36b15a04d228e79c4c1722a3545eaa14a9fa81:/apps/explorer/models.py?ds=inline 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('.'))