Skip to content

Commit

Permalink
sin clientessssss
Browse files Browse the repository at this point in the history
  • Loading branch information
logos914 committed Nov 19, 2024
1 parent 470c2d6 commit e7448f6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions models/vehiculo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from sqlalchemy import ForeignKey
from sqlalchemy.orm import Mapped, relationship, mapped_column
from extensiones import db
from models.cliente import Cliente
from models.modelo_vehiculo import ModeloVehiculo
from models.usuario import Usuario

Expand All @@ -14,15 +13,13 @@ class Vehiculo(db.Model):
estado: Mapped[str] = mapped_column(nullable=True)
modelo: Mapped['ModeloVehiculo'] = relationship('ModeloVehiculo', backref='vehiculos')
operador: Mapped['Usuario'] = relationship('Usuario', backref='vehiculo')
cliente: Mapped['Cliente'] = relationship('Cliente', backref='vehiculo_asignado')
kilometraje:Mapped[int] = mapped_column(nullable=True)

def serialize(self):
return {
'id': self.id,
'modelo': self.modelo.serialize() if self.modelo else None,
'operador': self.operador if self.operador else None,
'cliente': self.cliente if self.cliente else None,
'matricula': self.matricula,
'id_traccar': self.id_traccar,
'estado': self.estado
Expand Down

0 comments on commit e7448f6

Please sign in to comment.