MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / _m2m_getter

Function _m2m_getter

tortoise/models.py:138–145  ·  view source on GitHub ↗
(
    self: Model, _key: str, field_object: ManyToManyFieldInstance
)

Source from the content-addressed store, hash-verified

136
137
138def _m2m_getter(
139 self: Model, _key: str, field_object: ManyToManyFieldInstance
140) -> ManyToManyRelation:
141 val = getattr(self, _key, None)
142 if val is None:
143 val = ManyToManyRelation(self, field_object)
144 setattr(self, _key, val)
145 return val
146
147
148def _get_comments(cls: type[Model]) -> dict[str, str]:

Callers

nothing calls this directly

Calls 1

ManyToManyRelationClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…