-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sort
Department
s and add stats and cacheing (#995)
## Fixes issue #797 ## Description of Changes Added sorting by `state` and `name` columns for department listing , added baseline `Department` statistics for each department, and added cacheing for those `Department` statistics. ## Screenshots (if appropriate) Before change: <img width="1220" alt="Screenshot 2023-07-28 at 3 24 50 PM" src="https://github.com/lucyparsons/OpenOversight/assets/5885605/1f8a7a17-f4b4-4593-8651-a3b4f0c6dfdf"> After change: <img width="1220" alt="Screenshot 2023-07-28 at 3 27 03 PM" src="https://github.com/lucyparsons/OpenOversight/assets/5885605/77f70398-53aa-4f5d-af94-d9b4bc06834c"> ## Tests and linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
- Loading branch information
1 parent
ab6fd58
commit 9bef4ba
Showing
6 changed files
with
127 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import os | ||
|
||
|
||
# Cache Key Constants | ||
KEY_TOTAL_ASSIGNMENTS = "total_assignments" | ||
KEY_TOTAL_INCIDENTS = "total_incidents" | ||
KEY_TOTAL_OFFICERS = "total_officers" | ||
|
||
# Config Key Constants | ||
KEY_OFFICERS_PER_PAGE = "OFFICERS_PER_PAGE" | ||
KEY_TIMEZONE = "TIMEZONE" | ||
|
||
# File Handling Constants | ||
ENCODING_UTF_8 = "utf-8" | ||
SAVED_UMASK = os.umask(0o077) # Ensure the file is read/write by the creator only | ||
|
||
# File Name Constants | ||
SERVICE_ACCOUNT_FILE = "service_account_key.json" | ||
|
||
# Key Constants | ||
KEY_OFFICERS_PER_PAGE = "OFFICERS_PER_PAGE" | ||
KEY_TIMEZONE = "TIMEZONE" | ||
|
||
# Numerical Constants | ||
BYTE = 1 | ||
KILOBYTE = 1024 * BYTE | ||
MEGABYTE = 1024 * KILOBYTE | ||
MINUTE = 60 | ||
HOUR = 60 * MINUTE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters