MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _commit_all_states

Method _commit_all_states

lib/sqlalchemy/orm/state.py:1019–1040  ·  view source on GitHub ↗

Mass / highly inlined version of commit_all().

(
        self,
        iter_: Iterable[Tuple[InstanceState[Any], _InstanceDict]],
        instance_dict: Optional[IdentityMap] = None,
    )

Source from the content-addressed store, hash-verified

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
1043class AttributeState:

Callers 3

_commit_allMethod · 0.95
_register_persistentMethod · 0.80
_flushMethod · 0.80

Calls 3

clearMethod · 0.45
difference_updateMethod · 0.45
discardMethod · 0.45

Tested by

no test coverage detected