summaryrefslogtreecommitdiff
path: root/jimbrella/database.py
AgeCommit message (Collapse)Author
2021-10-27Provide exception messagesFrederick Yin
UmbrellaNotFoundError: serial UmbrellaValueError: field
2021-10-27Database.update includes message in exceptionsFrederick Yin
2021-10-27Separate Lockfile into new classFrederick Yin
2021-10-26Wrap static methods in Database in decoratorFrederick Yin
2021-10-24One major, multiple minor changes to DatabaseFrederick Yin
Major: - New update(umb) method as an interface to _update(umb), with convenience and safeguards. Minor: - New exception: UmbrellaValueError - All datetime objects are cast naive - Database._write(umbrellas) raises exception after performing recovery - human_datetime includes seconds in output
2021-10-24Database.group_by_status lists all statusesFrederick Yin
If there are no umbrellas that are overdue in the database, the behavior was to omit them from the returned dict. Now their values are []. Also, small comment fix.
2021-10-23Database high-level operations no longer require dateFrederick Yin
2021-10-22Mark overdue umbrellas in DatabaseFrederick Yin
2021-10-22Exposed database operations take argument "date"Frederick Yin
Namely, Database.take_away and Database.give_back "date" is an instance of datetime.datatime
2021-10-22Define application-specific exceptionsFrederick Yin
2021-10-20Separate "overdue" from "lent" as a distinct statusFrederick Yin
2021-10-20Add page /admin/umbrellasFrederick Yin
Lists all umbrellas in a table.
2021-10-20Move database utilities to database.pyFrederick Yin
It may not be a good idea to scatter database utilities around utils.py. With this in mind, I moved them to database.py as static methods under the class Database.
2021-10-19Database lockFrederick Yin
Is a lockfile named "$DATABASE_NAME.lock". `Database._write()` prevents race conditions by enforcing the lock, and waiting until a previous lock is released.
2021-10-19Basic database operationsFrederick Yin
Define database format. Implement basic I/O operations and take_away / give_back methods.