Replace ModelObject
The original reason why I designed the ModelObject
was because I thought subclassing SQLAlchemy models was impossible. It turns out there is a solution in the form of single-table inheritance, which we can use to subclass the notification_log
model into Alert
, Handover
, Message
and Preventive
, while keeping them all in a single table.
All the functionality of the other ModelObject
subclasses should easily be transferrable directly to the relevant models.
Doing this allows us to have full functionality directly in the models, without having to encase them in a ModelObject structure first, which is inconvenient at the best of times, and downright costing us performance at the worst of times.
Edited by Callum Dickinson