Sort files in fileupload.
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 11 Mar 2013 15:11:09 +0000 (16:11 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 11 Mar 2013 15:11:09 +0000 (16:11 +0100)
apps/fileupload/views.py

index 8863465..d08bfd3 100644 (file)
@@ -99,7 +99,7 @@ class UploadView(FormView):
             files = []
             path = self.get_safe_path()
             if os.path.isdir(path):
             files = []
             path = self.get_safe_path()
             if os.path.isdir(path):
-                for f in os.listdir(path):
+                for f in sorted(os.listdir(path)):
                     file_info = {
                         "name": f,
                     }
                     file_info = {
                         "name": f,
                     }