MCPcopy
hub / github.com/tortoise/tortoise-orm / get

Method get

tortoise/queryset.py:851–859  ·  view source on GitHub ↗

Fetch exactly one object matching the parameters.

(self, *args: Q, **kwargs: Any)

Source from the content-addressed store, hash-verified

849 return queryset._as_single()
850
851 def get(self, *args: Q, **kwargs: Any) -> QuerySetSingle[MODEL]:
852 """
853 Fetch exactly one object matching the parameters.
854 """
855 queryset = self.filter(*args, **kwargs)
856 queryset._limit = 2
857 queryset._single = True
858 queryset._raise_does_not_exist = True
859 return queryset # type: ignore
860
861 async def in_bulk(
862 self, id_list: Iterable[PRIMARY_KEY], field_name: str

Callers 3

resolve_orderingMethod · 0.45
_make_queryMethod · 0.45

Calls 1

filterMethod · 0.95

Tested by

no test coverage detected