From a0f7ca0e1751996760db7f9d7f782f3a9a426304 Mon Sep 17 00:00:00 2001 From: guille Date: Fri, 24 May 2024 11:19:43 +0200 Subject: [PATCH] Update idf --- hub/persistence/repositories/city.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hub/persistence/repositories/city.py b/hub/persistence/repositories/city.py index 17e018a6..65851bd5 100644 --- a/hub/persistence/repositories/city.py +++ b/hub/persistence/repositories/city.py @@ -136,3 +136,7 @@ class City(Repository): except SQLAlchemyError as err: logging.error('Error while fetching city by name %s', 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] \ No newline at end of file