MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / fdel

Method fdel

lib/sqlalchemy/orm/descriptor_props.py:357–371  ·  view source on GitHub ↗
(instance: Any)

Source from the content-addressed store, hash-verified

355 setattr(instance, key, value)
356
357 def fdel(instance: Any) -> None:
358 state = attributes.instance_state(instance)
359 dict_ = attributes.instance_dict(instance)
360 attr = state.manager[self.key]
361
362 if attr.dispatch._active_history:
363 previous = fget(instance)
364 dict_.pop(self.key, None)
365 else:
366 previous = dict_.pop(self.key, LoaderCallableStatus.NO_VALUE)
367
368 attr = state.manager[self.key]
369 attr.dispatch.remove(state, previous, attr.impl)
370 for key in self._attribute_keys:
371 setattr(instance, key, None)
372
373 self.descriptor = property(fget, fset, fdel)
374

Callers

nothing calls this directly

Calls 2

popMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected