From cbf419cb79f4a0d06c65167f81f10f503fff391d Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Tue, 26 Oct 2021 21:55:39 +0800 Subject: Wrap static methods in Database in decorator --- jimbrella/database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jimbrella/database.py b/jimbrella/database.py index d672653..37f6c82 100644 --- a/jimbrella/database.py +++ b/jimbrella/database.py @@ -258,6 +258,7 @@ class Database: return self._update(umb) + @staticmethod def group_by_status(umbrellas) -> dict: """(static method) Returns umbrellas grouped into a dict by their status.""" keys = set([umb["status"] for umb in umbrellas]) @@ -267,6 +268,7 @@ class Database: statuses[key] = [umb for umb in umbrellas if umb["status"] == key] return statuses + @staticmethod def find_overdue(umbrellas) -> list: """(static method) Returns umbrellas in possession of their tenant for too long.""" now = datetime.now() -- cgit v1.2.3