MCPcopy Create free account
hub / github.com/apache/devlake / ToolModel

Class ToolModel

backend/python/pydevlake/pydevlake/model.py:143–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142
143class ToolModel(ToolTable, NoPKModel):
144 connection_id: Optional[int] = Field(primary_key=True, auto_increment=False)
145
146 def domain_id(self):
147 """
148 Generate an identifier for domain entities
149 originates from self.
150 """
151 return domain_id(type(self), self.connection_id, *self.primary_keys())
152
153 def primary_keys(self) -> Iterable[object]:
154 model_type = type(self)
155 mapper = inspect(model_type)
156 for primary_key_column in mapper.primary_key:
157 prop = mapper.get_property_by_column(primary_key_column)
158 if prop.key == 'connection_id':
159 continue
160 yield getattr(self, prop.key)
161
162
163class DomainModel(NoPKModel):

Callers

nothing calls this directly

Calls 1

FieldFunction · 0.90

Tested by

no test coverage detected