def update_order_status(db, order_id, new_status): order = db.query(Order).get(order_id) order.status = new_status db.commit()