Set the value of an attribute with no history events. Cancels any previous history present. The value should be a scalar value for scalar-holding attributes, or an iterable for any collection-holding attribute. This is the same underlying method used when a lazy loader fires o
(instance: object, key: str, value: Any)
| 2718 | |
| 2719 | |
| 2720 | def set_committed_value(instance: object, key: str, value: Any) -> None: |
| 2721 | """Set the value of an attribute with no history events. |
| 2722 | |
| 2723 | Cancels any previous history present. The value should be |
| 2724 | a scalar value for scalar-holding attributes, or |
| 2725 | an iterable for any collection-holding attribute. |
| 2726 | |
| 2727 | This is the same underlying method used when a lazy loader |
| 2728 | fires off and loads additional data from the database. |
| 2729 | In particular, this method can be used by application code |
| 2730 | which has loaded additional attributes or collections through |
| 2731 | separate queries, which can then be attached to an instance |
| 2732 | as though it were part of its original loaded state. |
| 2733 | |
| 2734 | """ |
| 2735 | state, dict_ = instance_state(instance), instance_dict(instance) |
| 2736 | state.manager[key].impl.set_committed_value(state, dict_, value) |
| 2737 | |
| 2738 | |
| 2739 | def set_attribute( |
nothing calls this directly
no test coverage detected