spinetoolbox.spine_db_commands
¶
QUndoCommand subclasses for modifying the db.
authors: |
|
---|---|
date: | 31.1.2020 |
Module Contents¶
-
class
spinetoolbox.spine_db_commands.
CommandBase
(db_mngr, db_map)[source]¶ Bases:
PySide2.QtWidgets.QUndoCommand
Parameters: - db_mngr (SpineDBManager) – SpineDBManager instance
- db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
-
block_notifications
(self, func)[source]¶ Calls given function while blocking notifications on the affected Data Store forms. This is so undo() and subsequent redo() calls don’t trigger the same notifications over and over.
-
static
redomethod
(func)[source]¶ Wraps the given function with a mechanism to determine this command’s completion. The command is considered completed if calling the function triggers a certain signal. Once the command is completed, we don’t listen to the signal anymore and we also block notifications on the affected Data Store forms. If the signal is not received, then the command is declared obsolete.
-
class
spinetoolbox.spine_db_commands.
AddItemsCommand
(db_mngr, db_map, data, item_type)[source]¶ Bases:
spinetoolbox.spine_db_commands.CommandBase
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
-
class
spinetoolbox.spine_db_commands.
AddCheckedParameterValuesCommand
(db_mngr, db_map, data)[source]¶
-
class
spinetoolbox.spine_db_commands.
UpdateItemsCommand
(db_mngr, db_map, data, item_type)[source]¶ Bases:
spinetoolbox.spine_db_commands.CommandBase
Parameters: - db_mngr (SpineDBManager) – SpineDBManager instance
- db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
- data (list) – list of dict-items to update
- item_type (str) – the item type
-
class
spinetoolbox.spine_db_commands.
UpdateCheckedParameterValuesCommand
(db_mngr, db_map, data)[source]¶
-
class
spinetoolbox.spine_db_commands.
SetParameterDefinitionTagsCommand
(db_mngr, db_map, data)[source]¶
-
class
spinetoolbox.spine_db_commands.
RemoveItemsCommand
(db_mngr, db_map, typed_data)[source]¶ Bases:
spinetoolbox.spine_db_commands.CommandBase
Parameters: - db_mngr (SpineDBManager) – SpineDBManager instance
- db_map (DiffDatabaseMapping) – DiffDatabaseMapping instance
- typed_data (dict) – lists of dict-items to remove keyed by string type