home · contact · privacy
Ensure BaseModel.all() returns sorted results.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 1 Aug 2024 15:11:53 +0000 (17:11 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 1 Aug 2024 15:11:53 +0000 (17:11 +0200)
plomtask/db.py

index 67a7fc766ce607095520e174c944f957667011d7..dc61f1a3c01d32595f4701a86295cff9d7a046fb 100644 (file)
@@ -477,7 +477,7 @@ class BaseModel(Generic[BaseModelId]):
                 item = cls.by_id(db_conn, id_)
                 assert item.id_ is not None
                 items[item.id_] = item
-        return list(items.values())
+        return sorted(list(items.values()))
 
     @classmethod
     def by_date_range_with_limits(cls: type[BaseModelInstance],