MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / delete

Method delete

lib/sqlalchemy/orm/attributes.py:1841–1852  ·  view source on GitHub ↗
(self, state: InstanceState[Any], dict_: _InstanceDict)

Source from the content-addressed store, hash-verified

1839 state._modified_event(dict_, self, NO_VALUE, True)
1840
1841 def delete(self, state: InstanceState[Any], dict_: _InstanceDict) -> None:
1842 if self.key not in dict_:
1843 return
1844
1845 state._modified_event(dict_, self, NO_VALUE, True)
1846
1847 collection = self.get_collection(state, state.dict)
1848 collection.clear_with_event()
1849
1850 # key is always present because we checked above. e.g.
1851 # del is a no-op if collection not present.
1852 del dict_[self.key]
1853
1854 def _default_value(
1855 self, state: InstanceState[Any], dict_: _InstanceDict

Callers

nothing calls this directly

Calls 3

get_collectionMethod · 0.95
clear_with_eventMethod · 0.80
_modified_eventMethod · 0.45

Tested by

no test coverage detected