def delete_reserva(id): reserva = Reserva.query.filter(Reserva.idreserva == id).first() if reserva.idreserva > 0: #ARREGLAR db_session.delete(reserva) db_session.commit() return redirect(url_for(session.get('pag_actual')))
def delete_socio(id): socio = Socio.query.filter(Socio.idsocio == id).first() if socio.idsocio > 0: # ARREGLAR db_session.delete(socio) db_session.commit() return redirect(url_for("socios.view_socios"))
def delete(maintenance_id): maintenance_event = MaintenanceEvent.get_by_id(maintenance_id) if maintenance_event: db_session.delete(maintenance_event) db_session.commit() return redirect(url_for('maintenance.index'))
def delete_cancha(id): cancha = Cancha.query.filter(Cancha.idcancha == id).first() print cancha if cancha.idcancha > 0: #ARREGLAR print cancha.idcancha db_session.delete(cancha) db_session.commit() return redirect(url_for('canchas.view_canchas'))