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)
| 2810 | |
| 2811 | |
| 2812 | def del_attribute(instance: object, key: str) -> None: |
| 2813 | """Delete the value of an attribute, firing history events. |
| 2814 | |
| 2815 | This function may be used regardless of instrumentation |
| 2816 | applied directly to the class, i.e. no descriptors are required. |
| 2817 | Custom attribute management schemes will need to make usage |
| 2818 | of this method to establish attribute state as understood |
| 2819 | by SQLAlchemy. |
| 2820 | |
| 2821 | """ |
| 2822 | state, dict_ = instance_state(instance), instance_dict(instance) |
| 2823 | state.manager[key].impl.delete(state, dict_) |
| 2824 | |
| 2825 | |
| 2826 | def flag_modified(instance: object, key: str) -> None: |