spinetoolbox.spine_db_editor.mvcmodels.parameter_tag_model

A tree model for parameter_tags.

authors
  1. Marin (KTH)

date

28.6.2019

Module Contents

Classes

DBItem

An item representing a db.

TagItem

Paints the last item gray.

ParameterTagModel

A model to display parameter_tag data in a tree view.

class spinetoolbox.spine_db_editor.mvcmodels.parameter_tag_model.DBItem(db_map)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EmptyChildMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.NonLazyDBItem

An item representing a db.

Init class.

Args

db_mngr (SpineDBManager) db_map (DiffDatabaseMapping)

empty_child(self)[source]
class spinetoolbox.spine_db_editor.mvcmodels.parameter_tag_model.TagItem(identifier=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.LastGrayMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.EditableMixin, spinetoolbox.spine_db_editor.mvcmodels.tree_item_utility.NonLazyTreeItem

Paints the last item gray.

Initializes item.

Parameters

model (MinimalTreeModel, NoneType) – The model where the item belongs.

property item_type(self)[source]
property db_map(self)[source]
property id(self)[source]
property item_data(self)[source]
property tag(self)[source]
add_item_to_db(self, db_item)[source]
update_item_in_db(self, db_item)[source]
header_data(self, column)[source]
data(self, column, role=Qt.DisplayRole)[source]

Returns data for given column and role.

set_data(self, column, value, role=Qt.EditRole)[source]

Sets data for this item.

Parameters
  • column (int) – column index

  • value (object) – a new value

  • role (int) – role of the new value

Returns

True if data was set successfully, False otherwise

Return type

bool

handle_updated_in_db(self)[source]
class spinetoolbox.spine_db_editor.mvcmodels.parameter_tag_model.ParameterTagModel(parent, db_mngr, *db_maps)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.tree_model_base.TreeModelBase

A model to display parameter_tag data in a tree view.

Parameters

Initialize class

add_parameter_tags(self, db_map_data)[source]
update_parameter_tags(self, db_map_data)[source]
remove_parameter_tags(self, db_map_data)[source]
static _make_db_item(db_map)[source]
static _top_children()[source]
headerData(self, section, orientation, role=Qt.DisplayRole)[source]