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)
| 2745 | |
| 2746 | |
| 2747 | def set_committed_value(instance: object, key: str, value: Any) -> None: |
| 2748 | """Set the value of an attribute with no history events. |
| 2749 | |
| 2750 | Cancels any previous history present. The value should be |
| 2751 | a scalar value for scalar-holding attributes, or |
| 2752 | an iterable for any collection-holding attribute. |
| 2753 | |
| 2754 | This is the same underlying method used when a lazy loader |
| 2755 | fires off and loads additional data from the database. |
| 2756 | In particular, this method can be used by application code |
| 2757 | which has loaded additional attributes or collections through |
| 2758 | separate queries, which can then be attached to an instance |
| 2759 | as though it were part of its original loaded state. |
| 2760 | |
| 2761 | """ |
| 2762 | state, dict_ = instance_state(instance), instance_dict(instance) |
| 2763 | state.manager[key].impl.set_committed_value(state, dict_, value) |
| 2764 | |
| 2765 | |
| 2766 | def set_attribute( |
nothing calls this directly
no test coverage detected