passerine.db.uow

Note

This page is automatically generated. If you don’t see anything, this means this sub-module is not meant to be used. If you really want to know what it is, please check out the source code at passerine/db/uow.py.

class passerine.db.uow.DependencyNode(record)

Dependency Node

This is designed to be bi-directional to maximize flexibility on traversing the graph.

class passerine.db.uow.UnitOfWork(entity_manager)

Unit of Work

This Unit of Work (UOW) is designed specifically for non-relational databases.

Note

It is the design decision to make sub-commit methods available so that when it is used with Imagination Framework, the other Imagination entity may intercept before or after actually committing data. In the other word, Imagination Framework acts as an event controller for any actions (public methods) of this class.

commit(sync_mode=True, check_associations=True)

Commit the changes.

Warning

Both flags should not be set to False.

Parameters:
  • sync_mode (bool) – Enable the synchronous mode. (default: True)
  • check_associations (bool) – Check the associations. (default: True)
refresh(entity)

Refresh the entity

Note

This method

Parameters:entity (object) – the target entity
register_clean(entity)

Register the entity with the clean bit

Parameters:entity (object) – the entity to register
register_deleted(entity)

Register the entity with the removal bit

Parameters:entity (object) – the entity to register
register_dirty(entity)

Register the entity with the dirty bit

Parameters:entity (object) – the entity to register
register_new(entity)

Register a new entity

Parameters:entity (object) – the entity to register