MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _commit_all

Method _commit_all

lib/sqlalchemy/orm/state.py:996–1016  ·  view source on GitHub ↗

commit all attributes unconditionally. This is used after a flush() or a full load/refresh to remove all pending state from the instance. - all attributes are marked as "committed" - the "strong dirty reference" is removed - the "modified" flag is set to

(
        self,
        dict_: _InstanceDict,
        instance_dict: Optional[IdentityMap] = None,
    )

Source from the content-addressed store, hash-verified

994 del self.callables[key]
995
996 def _commit_all(
997 self,
998 dict_: _InstanceDict,
999 instance_dict: Optional[IdentityMap] = None,
1000 ) -> None:
1001 """commit all attributes unconditionally.
1002
1003 This is used after a flush() or a full load/refresh
1004 to remove all pending state from the instance.
1005
1006 - all attributes are marked as "committed"
1007 - the "strong dirty reference" is removed
1008 - the "modified" flag is set to False
1009 - any "expired" markers for scalar attributes loaded are removed.
1010 - lazy load callables for objects / collections *stay*
1011
1012 Attributes marked as "expired" can potentially remain
1013 "expired" after this step if a value was not populated in state.dict.
1014
1015 """
1016 self._commit_all_states([(self, dict_)], instance_dict)
1017
1018 @classmethod
1019 def _commit_all_states(

Callers 15

_instanceFunction · 0.80
_mergeMethod · 0.80
test_basicMethod · 0.80
test_deferredMethod · 0.80
test_historyMethod · 0.80
test_updateMethod · 0.80

Calls 1

_commit_all_statesMethod · 0.95

Tested by 15

test_basicMethod · 0.64
test_deferredMethod · 0.64
test_historyMethod · 0.64
test_updateMethod · 0.64
test_basicMethod · 0.64
test_deferredMethod · 0.64