MCPcopy
hub / github.com/ormar-orm/ormar / clear

Method clear

ormar/relations/relation.py:92–99  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90 return proxy
91
92 def clear(self) -> None:
93 if self._type in (RelationType.PRIMARY, RelationType.THROUGH):
94 self.related_models = None
95 self._owner.__dict__[self.field_name] = None
96 elif self.related_models is not None:
97 related_models = cast("RelationProxy", self.related_models)
98 related_models._clear()
99 self._owner.__dict__[self.field_name] = None
100
101 @property
102 def through(self) -> type["Model"]:

Callers 10

test_gettingFunction · 0.45
test_cleaning_relatedFunction · 0.45
test_cascade_clearFunction · 0.45
bulk_updateMethod · 0.45
saveMethod · 0.45
updateMethod · 0.45
loadMethod · 0.45
load_allMethod · 0.45

Calls 1

_clearMethod · 0.80

Tested by 5

test_gettingFunction · 0.36
test_cleaning_relatedFunction · 0.36
test_cascade_clearFunction · 0.36