Mass / highly inlined version of commit_all().
(
self,
iter_: Iterable[Tuple[InstanceState[Any], _InstanceDict]],
instance_dict: Optional[IdentityMap] = None,
)
| 1017 | |
| 1018 | @classmethod |
| 1019 | def _commit_all_states( |
| 1020 | self, |
| 1021 | iter_: Iterable[Tuple[InstanceState[Any], _InstanceDict]], |
| 1022 | instance_dict: Optional[IdentityMap] = None, |
| 1023 | ) -> None: |
| 1024 | """Mass / highly inlined version of commit_all().""" |
| 1025 | |
| 1026 | for state, dict_ in iter_: |
| 1027 | state_dict = state.__dict__ |
| 1028 | |
| 1029 | state.committed_state.clear() |
| 1030 | |
| 1031 | if "_pending_mutations" in state_dict: |
| 1032 | del state_dict["_pending_mutations"] |
| 1033 | |
| 1034 | state.expired_attributes.difference_update(dict_) |
| 1035 | |
| 1036 | if instance_dict and state.modified: |
| 1037 | instance_dict._modified.discard(state) |
| 1038 | |
| 1039 | state.modified = state.expired = False |
| 1040 | state._strong_obj = None |
| 1041 | |
| 1042 | |
| 1043 | class AttributeState: |
no test coverage detected