MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / finalize_flush_changes

Method finalize_flush_changes

lib/sqlalchemy/orm/unitofwork.py:469–488  ·  view source on GitHub ↗

Mark processed objects as clean / deleted after a successful flush(). This method is called within the flush() method after the execute() method has succeeded and the transaction has been committed.

(self)

Source from the content-addressed store, hash-verified

467 rec.execute(self)
468
469 def finalize_flush_changes(self) -> None:
470 """Mark processed objects as clean / deleted after a successful
471 flush().
472
473 This method is called within the flush() method after the
474 execute() method has succeeded and the transaction has been committed.
475
476 """
477 if not self.states:
478 return
479
480 states = set(self.states)
481 isdel = {
482 s for (s, (isdelete, listonly)) in self.states.items() if isdelete
483 }
484 other = states.difference(isdel)
485 if isdel:
486 self.session._remove_newly_deleted(isdel)
487 if other:
488 self.session._register_persistent(other)
489
490
491class _IterateMappersMixin:

Callers 1

_flushMethod · 0.95

Calls 4

_remove_newly_deletedMethod · 0.80
_register_persistentMethod · 0.80
itemsMethod · 0.45
differenceMethod · 0.45

Tested by

no test coverage detected