def note_delete(request): """ 留言删除路由 """ note_id = request.query.get('id', None) if note_id is not None: Note.delete([ note_id, ]) return redirect(request, '/note') else: return error(request, 404)
def delete_note(): no = input("Ingrese el ID de la nota: ") opt = input("Desea elimnar la nota (y/n)") if opt == "y": Note.delete(no)