spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item
¶
Classes to represent entities in a tree.
- authors
Vennström (VTT), M. Marin (KTH)
- date
11.3.2019
Module Contents¶
Classes¶
A tree item that may belong in multiple databases. |
|
An object tree root item. |
|
A relationship tree root item. |
|
An entity_class item. |
|
An object_class item. |
|
A relationship_class item. |
|
A relationship_class item. |
|
A relationship_class item. |
|
A member object class item. |
|
An entity item. |
|
An object item. |
|
A member object item. |
|
A relationship item. |
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityRootItem(model=None, db_map_id=None)[source]¶
Bases:
spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_item.MultiDBTreeItem
A tree item that may belong in multiple databases.
Init class.
- Parameters
db_mngr (SpineDBManager) – a database manager
db_map_data (dict) – maps instances of DiffDatabaseMapping to the id of the item in that db
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.ObjectTreeRootItem(model=None, db_map_id=None)[source]¶
Bases:
EntityRootItem
An object tree root item.
Init class.
- Parameters
db_mngr (SpineDBManager) – a database manager
db_map_data (dict) – maps instances of DiffDatabaseMapping to the id of the item in that db
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.RelationshipTreeRootItem(model=None, db_map_id=None)[source]¶
Bases:
EntityRootItem
A relationship tree root item.
Init class.
- Parameters
db_mngr (SpineDBManager) – a database manager
db_map_data (dict) – maps instances of DiffDatabaseMapping to the id of the item in that db
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityClassItem(*args, **kwargs)[source]¶
Bases:
spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_item.MultiDBTreeItem
An entity_class item.
Overridden method to declare group_child_count attribute.
- raise_group_children_by_id(self, db_map_ids)[source]¶
Moves group children to the top of the list.
- Parameters
db_map_ids (dict) – set of ids corresponding to newly inserted group children, keyed by DiffDatabaseMapping
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.ObjectClassItem(*args, **kwargs)[source]¶
Bases:
EntityClassItem
An object_class item.
Overridden method to declare group_child_count attribute.
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.RelationshipClassItemBase(*args, **kwargs)[source]¶
Bases:
EntityClassItem
A relationship_class item.
Overridden method to declare group_child_count attribute.
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.RelationshipClassItem(*args, **kwargs)[source]¶
Bases:
RelationshipClassItemBase
A relationship_class item.
Overridden method to declare group_child_count attribute.
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.ObjectRelationshipClassItem(*args, **kwargs)[source]¶
Bases:
RelationshipClassItemBase
A relationship_class item.
Overridden method to declare group_child_count attribute.
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.MemberObjectClassItem(*args, **kwargs)[source]¶
Bases:
ObjectClassItem
A member object class item.
Overridden method to declare group_child_count attribute.
- property display_id(self)[source]¶
“Returns an id for display based on the display key. This id must be the same across all db_maps. If it’s not, this property becomes None and measures need to be taken (see update_children_by_id).
- _display_icon(self, for_group=False)[source]¶
Returns icon for this item as if it was indeed an object class.
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityItem(model=None, db_map_id=None)[source]¶
Bases:
spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_item.MultiDBTreeItem
An entity item.
Init class.
- Parameters
db_mngr (SpineDBManager) – a database manager
db_map_data (dict) – maps instances of DiffDatabaseMapping to the id of the item in that db
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.ObjectItem(model=None, db_map_id=None)[source]¶
Bases:
EntityItem
An object item.
Init class.
- Parameters
db_mngr (SpineDBManager) – a database manager
db_map_data (dict) – maps instances of DiffDatabaseMapping to the id of the item in that db
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.MemberObjectItem(model=None, db_map_id=None)[source]¶
Bases:
ObjectItem
A member object item.
Init class.
- Parameters
db_mngr (SpineDBManager) – a database manager
db_map_data (dict) – maps instances of DiffDatabaseMapping to the id of the item in that db
- class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.RelationshipItem(*args, **kwargs)[source]¶
Bases:
EntityItem
A relationship item.
Overridden method to make sure we never try to fetch this item.