diff --git a/backend/db/implementation/SqlAbstractDAO.py b/backend/db/implementation/SqlAbstractDAO.py index 06a5cffa..cc7f2c2a 100644 --- a/backend/db/implementation/SqlAbstractDAO.py +++ b/backend/db/implementation/SqlAbstractDAO.py @@ -16,7 +16,7 @@ class SqlAbstractDAO(Generic[T, D]): def __init__(self) -> None: self.model_class: type[T] - def get_object(self, ident: int) -> D: + def get(self, ident: int) -> D: with Session(engine) as session: generic_object: T | None = session.get(self.model_class, ident) diff --git a/backend/db/interface/AbstractDAO.py b/backend/db/interface/AbstractDAO.py index d42b2551..2c4ade30 100644 --- a/backend/db/interface/AbstractDAO.py +++ b/backend/db/interface/AbstractDAO.py @@ -8,7 +8,7 @@ class AbstractDAO(Generic[T, D], ABC): @abstractmethod - def get_object(self, ident: int) -> D: + def get(self, ident: int) -> D: raise NotImplementedError @abstractmethod diff --git a/backend/routes/teachers.py b/backend/routes/teachers.py index ff298241..c69579b1 100644 --- a/backend/routes/teachers.py +++ b/backend/routes/teachers.py @@ -16,7 +16,7 @@ def get_teachers() -> list[TeacherDataclass]: @teachers_router.get("/teachers/{teacher_id}") def get_teacher(teacher_id: int) -> TeacherDataclass: dao: TeacherDAO = SqlTeacherDAO() - return dao.get_object(teacher_id) + return dao.get(teacher_id) """