spinetoolbox.spine_db_editor.mvcmodels.empty_models
Empty models for parameter definitions and values.
Module Contents
Classes
Base class for all empty models that go in a CompoundModelBase subclass. |
|
An empty parameter_definition model. |
|
An empty parameter_value model. |
|
Makes relationships on the fly. |
- class spinetoolbox.spine_db_editor.mvcmodels.empty_models.EmptyModelBase(parent)[source]
Bases:
spinetoolbox.mvcmodels.empty_row_model.EmptyRowModel
Base class for all empty models that go in a CompoundModelBase subclass.
- Parameters
parent (CompoundModelBase) – the parent model
- add_items_to_db(db_map_data)[source]
Add items to db.
- Parameters
db_map_data (dict) – mapping DiffDatabaseMapping instance to list of items
- abstract _make_unique_id(item)[source]
Returns a unique id for the given model item (name-based). Used by handle_items_added to identify which rows have been added and thus need to be removed.
- handle_items_added(db_map_data)[source]
Runs when parameter definitions or values are added. Finds and removes model items that were successfully added to the db.
- batch_set_data(indexes, data)[source]
Sets data for indexes in batch. If successful, add items to db.
- _autocomplete_row(db_map, item)[source]
Fills in entity_class_name whenever other selections make it obvious.
- class spinetoolbox.spine_db_editor.mvcmodels.empty_models.EmptyParameterDefinitionModel(parent)[source]
Bases:
spinetoolbox.spine_db_editor.mvcmodels.single_and_empty_model_mixins.SplitValueAndTypeMixin
,ParameterMixin
,EmptyModelBase
An empty parameter_definition model.
- Parameters
parent (CompoundModelBase) – the parent model
- class spinetoolbox.spine_db_editor.mvcmodels.empty_models.EmptyParameterValueModel(parent)[source]
Bases:
spinetoolbox.spine_db_editor.mvcmodels.single_and_empty_model_mixins.MakeEntityOnTheFlyMixin
,spinetoolbox.spine_db_editor.mvcmodels.single_and_empty_model_mixins.SplitValueAndTypeMixin
,ParameterMixin
,EntityMixin
,EmptyModelBase
An empty parameter_value model.
- Parameters
parent (CompoundModelBase) – the parent model
- class spinetoolbox.spine_db_editor.mvcmodels.empty_models.EmptyEntityAlternativeModel(parent)[source]
Bases:
spinetoolbox.spine_db_editor.mvcmodels.single_and_empty_model_mixins.MakeEntityOnTheFlyMixin
,EntityMixin
,EmptyModelBase
Makes relationships on the fly.
- Parameters
parent (CompoundModelBase) – the parent model