I have a sqlalchemy model
class Service(db.Model):
__tablename__ = "service"
id = db.Column(db.String(10), db.ForeignKey('vehicle.id'), nullable=False, primary_key=True)
odometer = db.Column(db.Integer)
service_date = db.Column(db.DateTime)
And I'd like to send a notification to the front end through flask/javascript when one of the dates surpasses the current date. How do I check all the dates in a column and then execute a one time event for that particular date.
Edit: Ok so using a background scheduler like use BackgroundScheduler() from APScheduler to loop over the table and compare the dates was the best approach. Also creating a copy of the table purely for notifications so dates could be be removed or added as needed