MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / del_attribute

Function del_attribute

lib/sqlalchemy/orm/attributes.py:2787–2798  ·  view source on GitHub ↗

Delete the value of an attribute, firing history events. This function may be used regardless of instrumentation applied directly to the class, i.e. no descriptors are required. Custom attribute management schemes will need to make usage of this method to establish attribute state a

(instance: object, key: str)

Source from the content-addressed store, hash-verified

2785
2786
2787def del_attribute(instance: object, key: str) -> None:
2788 """Delete the value of an attribute, firing history events.
2789
2790 This function may be used regardless of instrumentation
2791 applied directly to the class, i.e. no descriptors are required.
2792 Custom attribute management schemes will need to make usage
2793 of this method to establish attribute state as understood
2794 by SQLAlchemy.
2795
2796 """
2797 state, dict_ = instance_state(instance), instance_dict(instance)
2798 state.manager[key].impl.delete(state, dict_)
2799
2800
2801def flag_modified(instance: object, key: str) -> None:

Callers 2

__delattr__Method · 0.90
__delattr__Method · 0.90

Calls 3

instance_stateFunction · 0.85
instance_dictFunction · 0.85
deleteMethod · 0.45

Tested by 1

__delattr__Method · 0.72