MCPcopy
hub / github.com/gpustack/gpustack / one_by_id

Method one_by_id

gpustack/mixins/active_record.py:115–128  ·  view source on GitHub ↗

Return the object with the given id. Return None if not found. If `for_update` is True, the row will be locked until the end of the transaction. If `options` is provided, it will be passed to the query for eager loading relationships.

(
        cls,
        session: AsyncSession,
        id: int,
        for_update: bool = False,
        options: Optional[List] = None,
    )

Source from the content-addressed store, hash-verified

113
114 @classmethod
115 async def one_by_id(
116 cls,
117 session: AsyncSession,
118 id: int,
119 for_update: bool = False,
120 options: Optional[List] = None,
121 ):
122 """Return the object with the given id. Return None if not found.
123
124 If `for_update` is True, the row will be locked until the end of the transaction.
125 If `options` is provided, it will be passed to the query for eager loading relationships.
126 """
127
128 return await session.get(cls, id, with_for_update=for_update, options=options)
129
130 @classmethod
131 async def first_by_field(cls, session: AsyncSession, field: str, value: Any):

Callers 15

_evaluateMethod · 0.80
_schedule_oneMethod · 0.80
dashboardFunction · 0.80
get_clusterFunction · 0.80
update_clusterFunction · 0.80
delete_clusterFunction · 0.80
set_default_clusterFunction · 0.80
create_worker_poolFunction · 0.80
get_registration_tokenFunction · 0.80
get_cluster_manifestsFunction · 0.80
get_cluster_dashboardFunction · 0.80
cluster_apiserver_proxyFunction · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected