Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Rename get_object() to get()
Browse files Browse the repository at this point in the history
  • Loading branch information
msathieu authored Feb 29, 2024
1 parent f810d0a commit cd23feb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/db/implementation/SqlAbstractDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion backend/db/interface/AbstractDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/routes/teachers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


"""
Expand Down

0 comments on commit cd23feb

Please sign in to comment.