X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/998977e74882d0c12413d7bc08c8475a78afbf18..b157bbf02932396c65c0aca9638c96200c4665df:/apps/explorer/models.py?ds=inline diff --git a/apps/explorer/models.py b/apps/explorer/models.py index 3b5848b7..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(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 ['/media/images/' + folder + '/' + fn for fn - in os.listdir(os.path.join(settings.IMAGE_DIR, folder)) - if not fn.startswith('.')] + 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('.'))