spinetoolbox.spine_db_commands

QUndoCommand subclasses for modifying the db.

Module Contents

Classes

AgedUndoStack

AgedUndoCommand

param parent

The parent command, used for defining macros.

SpineDBCommand

Base class for all commands that modify a Spine DB.

AddItemsCommand

Base class for all commands that modify a Spine DB.

UpdateItemsCommand

Base class for all commands that modify a Spine DB.

AddUpdateItemsCommand

Base class for all commands that modify a Spine DB.

RemoveItemsCommand

Base class for all commands that modify a Spine DB.

class spinetoolbox.spine_db_commands.AgedUndoStack[source]

Bases: PySide6.QtGui.QUndoStack

property redo_age[source]
property undo_age[source]
class spinetoolbox.spine_db_commands.AgedUndoCommand(parent=None, identifier=-1)[source]

Bases: PySide6.QtGui.QUndoCommand

Parameters

parent (QUndoCommand, optional) – The parent command, used for defining macros.

property age[source]
id()[source]

override

ours()[source]
mergeWith(command)[source]
redo()[source]
undo()[source]
class spinetoolbox.spine_db_commands.SpineDBCommand(db_mngr, db_map, **kwargs)[source]

Bases: AgedUndoCommand

Base class for all commands that modify a Spine DB.

Parameters
  • db_mngr (SpineDBManager) – SpineDBManager instance

  • db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance

class spinetoolbox.spine_db_commands.AddItemsCommand(db_mngr, db_map, item_type, data, check=True, **kwargs)[source]

Bases: SpineDBCommand

Base class for all commands that modify a Spine DB.

Parameters
  • db_mngr (SpineDBManager) – SpineDBManager instance

  • db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance

  • data (list) – list of dict-items to add

  • item_type (str) – the item type

redo()[source]
undo()[source]
class spinetoolbox.spine_db_commands.UpdateItemsCommand(db_mngr, db_map, item_type, data, check=True, **kwargs)[source]

Bases: SpineDBCommand

Base class for all commands that modify a Spine DB.

Parameters
  • db_mngr (SpineDBManager) – SpineDBManager instance

  • db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance

  • item_type (str) – the item type

  • data (list) – list of dict-items to update

redo()[source]
undo()[source]
class spinetoolbox.spine_db_commands.AddUpdateItemsCommand(db_mngr, db_map, item_type, data, check=True, **kwargs)[source]

Bases: SpineDBCommand

Base class for all commands that modify a Spine DB.

Parameters
  • db_mngr (SpineDBManager) – SpineDBManager instance

  • db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance

  • item_type (str) – the item type

  • data (list) – list of dict-items to add-update

redo()[source]
undo()[source]
class spinetoolbox.spine_db_commands.RemoveItemsCommand(db_mngr, db_map, item_type, ids, check=True, **kwargs)[source]

Bases: SpineDBCommand

Base class for all commands that modify a Spine DB.

Parameters
  • db_mngr (SpineDBManager) – SpineDBManager instance

  • db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance

  • item_type (str) – the item type

  • ids (set) – set of ids to remove

redo()[source]
undo()[source]