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('.'))