소스 검색

sort results

David 10 년 전
부모
커밋
8b3705673f
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      back/db.py

+ 2 - 2
back/db.py

@@ -19,7 +19,7 @@ class db():
 
     def uploaded(self):
         ret = []
-        for f in self.ul_files.find():
+        for f in self.ul_files.find().sort("finished_at",-1):
             item = jsonable(f)
             item["enqueued_at"]=item["enqueued_at"].strftime("%d/%m/%Y %H:%M")
             item["finished_at"]=item["finished_at"].strftime("%d/%m/%Y %H:%M")
@@ -45,7 +45,7 @@ class db():
         if _id:
             ret = jsonable(self.cut_files.find_one({"_id": ObjectId(_id)}))
         else:
-            ret = [ jsonable(c) for c in self.cut_files.find() ]
+            ret = [ jsonable(c) for c in self.cut_files.find().sort("job_end",-1) ]
 
         return ret