spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models
¶
Single models for parameter definitions and values (as ‘for a single entity’).
- authors
Marin (KTH)
- date
28.6.2019
Module Contents¶
Classes¶
A parameter model for a single entity_class to go in a CompoundParameterModel. |
|
Associates a parameter model with a single object_class. |
|
Associates a parameter model with a single relationship_class. |
|
A parameter_definition model for a single entity_class. |
|
A parameter_value model for a single entity_class. |
|
An object parameter_definition model for a single object_class. |
|
A relationship parameter_definition model for a single relationship_class. |
|
An object parameter_value model for a single object_class. |
|
A relationship parameter_value model for a single relationship_class. |
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleParameterModel(header, db_mngr, db_map, entity_class_id, lazy=False)[source]¶
Bases:
spinetoolbox.mvcmodels.minimal_table_model.MinimalTableModel
A parameter model for a single entity_class to go in a CompoundParameterModel. Provides methods to associate the model to an entity_class as well as to filter entities within the class.
Init class.
- Parameters
header (list) – list of field names for the header
- property item_type(self)[source]¶
The item type, either ‘parameter_value’ or ‘parameter_definition’, required by the data method.
- property entity_class_type(self)[source]¶
The entity_class type, either ‘object_class’ or ‘relationship_class’.
- insertRows(self, row, count, parent=QModelIndex())[source]¶
This model doesn’t support row insertion.
- get_field_item_data(self, field)[source]¶
Returns item data for given field.
- Parameters
field (str) – A field from the header
- Returns
str, str
- get_field_item(self, field, db_item)[source]¶
Returns a db item corresponding to the given field from the table header, or an empty dict if the field doesn’t contain db items.
- data(self, index, role=Qt.DisplayRole)[source]¶
Gets the id and database for the row, and reads data from the db manager using the item_type property. Paint the object_class icon next to the name. Also paint background of fixed indexes gray and apply custom format to JSON fields.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleObjectParameterMixin[source]¶
Associates a parameter model with a single object_class.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleRelationshipParameterMixin[source]¶
Associates a parameter model with a single relationship_class.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleParameterDefinitionMixin(*args, **kwargs)[source]¶
Bases:
spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.FillInParameterNameMixin
,spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.FillInValueListIdMixin
,spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.MakeParameterTagMixin
A parameter_definition model for a single entity_class.
Initializes lookup dicts.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleParameterValueMixin(*args, **kwargs)[source]¶
Bases:
spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.ValidateValueInListForUpdateMixin
,spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.FillInAlternativeIdMixin
,spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.ImposeEntityClassIdMixin
,spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.FillInParameterDefinitionIdsMixin
,spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.FillInEntityIdsMixin
A parameter_value model for a single entity_class.
Initializes lookup dicts.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleObjectParameterDefinitionModel(*args, **kwargs)[source]¶
Bases:
SingleObjectParameterMixin
,SingleParameterDefinitionMixin
,SingleParameterModel
An object parameter_definition model for a single object_class.
Initializes lookup dicts.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleRelationshipParameterDefinitionModel(*args, **kwargs)[source]¶
Bases:
SingleRelationshipParameterMixin
,SingleParameterDefinitionMixin
,SingleParameterModel
A relationship parameter_definition model for a single relationship_class.
Initializes lookup dicts.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleObjectParameterValueModel(*args, **kwargs)[source]¶
Bases:
SingleObjectParameterMixin
,SingleParameterValueMixin
,SingleParameterModel
An object parameter_value model for a single object_class.
Initializes lookup dicts.
- class spinetoolbox.spine_db_editor.mvcmodels.single_parameter_models.SingleRelationshipParameterValueModel(*args, **kwargs)[source]¶
Bases:
SingleRelationshipParameterMixin
,spinetoolbox.spine_db_editor.mvcmodels.parameter_mixins.MakeRelationshipOnTheFlyMixin
,SingleParameterValueMixin
,SingleParameterModel
A relationship parameter_value model for a single relationship_class.
Initializes lookup dicts.