diff options
author | Frederick Yin <fkfd@fkfd.me> | 2021-10-19 21:06:52 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2021-10-19 21:06:52 +0800 |
commit | 5dc9414d9fe790142545b233dcd02d1c355d0ca0 (patch) | |
tree | 06fb13b4cd1f0ef1aea76db7ff0a1c6985f49f03 /jimbrella/utils.py | |
parent | 1dfa5659e322136000ac37324e52edaaef5b28ab (diff) |
Flask web server prototype
Diffstat (limited to 'jimbrella/utils.py')
-rw-r--r-- | jimbrella/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/jimbrella/utils.py b/jimbrella/utils.py new file mode 100644 index 0000000..a9f4623 --- /dev/null +++ b/jimbrella/utils.py @@ -0,0 +1,6 @@ +def group_by_status(umbrellas: list) -> dict: + keys = set([umb["status"] for umb in umbrellas]) + statuses = {} + for key in keys: + statuses[key] = [umb for umb in umbrellas if umb["status"] == key] + return statuses |