MCPcopy Create free account
hub / github.com/dbunt1tled/python-fast-api / get_by_id

Method get_by_id

src/core/db/repository.py:120–130  ·  view source on GitHub ↗
(
        self,
        uid: Any,
    )

Source from the content-addressed store, hash-verified

118 self._id_field = id_field
119
120 async def get_by_id(
121 self,
122 uid: Any,
123 ) -> T:
124 obj = await self.find_by_id(uid)
125 if obj is None:
126 raise DomainException(
127 error_no=ErrorNo.REPOSITORY_DATA_BY_ID_NOT_FOUND,
128 message=f"{self._model.__name__} with {self._id_field}={uid} not found",
129 )
130 return obj
131
132 async def find_by_id(
133 self,

Callers 3

updateMethod · 0.95
dispatchMethod · 0.45

Calls 2

find_by_idMethod · 0.95
DomainExceptionClass · 0.90

Tested by

no test coverage detected