From: Christian Heller Date: Thu, 1 Aug 2024 15:11:53 +0000 (+0200) Subject: Ensure BaseModel.all() returns sorted results. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bprefix%7D%7D/coming?a=commitdiff_plain;h=0b2de81a34c95e46cc8c8ec7f11af02574ec35fa;p=plomtask Ensure BaseModel.all() returns sorted results. --- diff --git a/plomtask/db.py b/plomtask/db.py index 67a7fc7..dc61f1a 100644 --- a/plomtask/db.py +++ b/plomtask/db.py @@ -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],