Skip to content

Commit

Permalink
Cambiar Estado a Vehiculos
Browse files Browse the repository at this point in the history
  • Loading branch information
logos914 committed Nov 20, 2024
1 parent acb77f2 commit 917153e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions routes/vehiculos.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,21 @@ def baja_vehiculo():
flash('Vehiculo dado de baja', 'success')

redirect(url_for('listar_vehiculos'))



#cambiar estado de vehiculo
@vehiculos.route('/vehiculos/estado', methods=['PUT'])
def cambiar_estado():
patente = request.form['patente']
estado = request.form['estado']

vehiculo = Vehiculo.encontrarPorPatente(patente)

vehiculo.estado = estado

Vehiculo.actualizar()

flash('Estado cambiado con exito', 'success')

redirect(url_for('vehiculos.listar_vehiculos'))

0 comments on commit 917153e

Please sign in to comment.