models.py
493 Bytes
from sqlalchemy import Column, INTEGER, VARCHAR
from database import ModelBase
class Nacionalidad(ModelBase):
__tablename__ = 'tb_Nacionalidad'
id = Column('idNacionalidad', INTEGER(), primary_key=True, nullable=False)
nombre = Column('Descripcion', VARCHAR(length=50), nullable=False)
nacionalidad_anses_id = Column('idNacionalidadAnses', INTEGER())
def __str__(self):
return f"{self.nombre}"
def __repr__(self):
return f"<Nacionalidad: {self}>"