spinetoolbox.spine_db_editor.mvcmodels.item_metadata_table_model
Contains ItemMetadataTableModel
and associated functionality.
Module Contents
Classes
Identifiers for hidden table columns. |
|
Allowed item types. |
|
Model for entity and parameter value metadata. |
- class spinetoolbox.spine_db_editor.mvcmodels.item_metadata_table_model.ExtraColumn[source]
Bases:
enum.IntEnum
Identifiers for hidden table columns.
Initialize self. See help(type(self)) for accurate signature.
- class spinetoolbox.spine_db_editor.mvcmodels.item_metadata_table_model.ItemType[source]
Bases:
enum.Enum
Allowed item types.
- class spinetoolbox.spine_db_editor.mvcmodels.item_metadata_table_model.ItemMetadataTableModel(db_mngr, db_maps, db_editor)[source]
Bases:
spinetoolbox.spine_db_editor.mvcmodels.metadata_table_model_base.MetadataTableModelBase
Model for entity and parameter value metadata.
- Parameters
db_mngr (SpineDBManager) – database manager
db_maps (Iterable of DatabaseMapping) – database maps
db_editor (SpineDBEditor) – DB editor
See base class.
- set_entity_ids(db_map_ids)[source]
Sets the model to show metadata from given entity.
- Parameters
db_map_ids (dict) – mapping from database mapping to entity’s id in that database
- set_parameter_value_ids(db_map_ids)[source]
Sets the model to show metadata from given parameter value.
- Parameters
db_map_ids (dict) – mapping from database mapping to value’s id in that database
- _reset_metadata(item_type, db_map_ids)[source]
Resets model.
- Parameters
item_type (ItemType) – current item type
db_map_ids (dict) – mapping from database mapping to value’s id in that database
- add_item_metadata(db_map_data)[source]
Adds new item metadata from database manager to the model.
- Parameters
db_map_data (dict) – added items keyed by database mapping