from models.alerts.alert import Alert from common.database import Database Database.initialize() alert_needing_update = Alert.find_needing_update() for alert in alert_needing_update: alert.load_item_price() alert.send_email_if_price_reached()
from common.database import Database from models.alerts.alert import Alert Database.initialize() alerts_needing_update = Alert.find_needing_update(10) for alert in alerts_needing_update: alert.load_item_price() alert.send_email_if_price_reached()
def get_update_and_send_email(): alerts_needing_update = Alert.find_needing_update() for alert in alerts_needing_update: alert.load_and_save_item_price() alert.send_email_if_price_reached()