MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _commit_all

Method _commit_all

lib/sqlalchemy/orm/state.py:991–1009  ·  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

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