spinetoolbox.spine_db_editor.mvcmodels.entity_tree_models
¶
Models to represent entities in a tree.
- authors
Vennström (VTT), M. Marin (KTH)
- date
11.3.2019
Module Contents¶
Classes¶
An ‘object-oriented’ tree model. |
|
A relationship-oriented tree model. |
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_models.ObjectTreeModel(parent, db_mngr, *db_maps)[source]¶
Bases:
spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_model.MultiDBTreeModel
An ‘object-oriented’ tree model.
Init class.
- Parameters
parent (SpineDBEditor) –
db_mngr (SpineDBManager) – A manager for the given db_maps
db_maps (iter) – DiffDatabaseMapping instances
- property root_item_type(self)[source]¶
Implement in subclasses to create a model specific to any entity type.
- _parent_object_data(self, db_map_data)[source]¶
Takes given object data and returns the same data keyed by parent tree-item.
- Parameters
db_map_data (dict) – maps DiffDatabaseMapping instances to list of items as dict
- Returns
maps parent tree-items to DiffDatabaseMapping instances to list of item ids
- Return type
dict
- _parent_relationship_class_data(self, db_map_data)[source]¶
Takes given relationship_class data and returns the same data keyed by parent tree-item.
- Parameters
db_map_data (dict) – maps DiffDatabaseMapping instances to list of items as dict
- Returns
maps parent tree-items to DiffDatabaseMapping instances to list of item ids
- Return type
dict
- _parent_relationship_data(self, db_map_data)[source]¶
Takes given relationship data and returns the same data keyed by parent tree-item.
- Parameters
db_map_data (dict) – maps DiffDatabaseMapping instances to list of items as dict
- Returns
maps parent tree-items to DiffDatabaseMapping instances to list of item ids
- Return type
dict
- _parent_entity_group_data(self, db_map_data)[source]¶
Takes given entity group data and returns the same data keyed by parent tree-item.
- Parameters
db_map_data (dict) – maps DiffDatabaseMapping instances to list of items as dict
- Returns
maps parent tree-items to DiffDatabaseMapping instances to list of item ids
- Return type
dict
- _parent_entity_member_data(self, db_map_data)[source]¶
Takes given entity member data and returns the same data keyed by parent tree-item.
- Parameters
db_map_data (dict) – maps DiffDatabaseMapping instances to list of items as dict
- Returns
maps parent tree-items to DiffDatabaseMapping instances to list of item ids
- Return type
dict
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_models.RelationshipTreeModel(parent, db_mngr, *db_maps)[source]¶
Bases:
spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_model.MultiDBTreeModel
A relationship-oriented tree model.
Init class.
- Parameters
parent (SpineDBEditor) –
db_mngr (SpineDBManager) – A manager for the given db_maps
db_maps (iter) – DiffDatabaseMapping instances
- property root_item_type(self)[source]¶
Implement in subclasses to create a model specific to any entity type.
- _parent_relationship_data(self, db_map_data)[source]¶
Takes given relationship data and returns the same data keyed by parent tree-item.
- Parameters
db_map_data (dict) – maps DiffDatabaseMapping instances to list of items as dict
- Returns
maps parent tree-items to DiffDatabaseMapping instances to list of item ids
- Return type
dict