Update idf

This commit is contained in:
Guille Gutierrez 2024-05-24 11:19:43 +02:00
parent 84d80d5d2a
commit a0f7ca0e17

View File

@ -136,3 +136,7 @@ class City(Repository):
except SQLAlchemyError as err: except SQLAlchemyError as err:
logging.error('Error while fetching city by name %s', err) logging.error('Error while fetching city by name %s', err)
raise SQLAlchemyError from err raise SQLAlchemyError from err
def get_by_id(self, city_id) -> Model:
with Session(self.engine) as session:
return session.execute(select(Model).where(Model.id == city_id)).first()[0]