spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item

Classes to represent entities in a tree.

Module Contents

Classes

EntityClassIndex

dict() -> new empty dictionary

EntityGroupIndex

dict() -> new empty dictionary

EntityIndex

dict() -> new empty dictionary

EntityTreeRootItem

A tree item that may belong in multiple databases.

EntityClassItem

An entity_class item.

EntityItem

An entity item.

class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityClassIndex[source]

Bases: spinetoolbox.fetch_parent.FetchIndex

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

process_item(item, db_map)[source]
class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityGroupIndex[source]

Bases: spinetoolbox.fetch_parent.FetchIndex

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

process_item(item, db_map)[source]
class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityIndex[source]

Bases: spinetoolbox.fetch_parent.FetchIndex

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

process_item(item, db_map)[source]
class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityTreeRootItem(*args, **kwargs)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_item.MultiDBTreeItem

A tree item that may belong in multiple databases.

Parameters
  • model (MinimalTreeModel, optional) – item’s model

  • db_map_ids (dict, optional) – maps instances of DatabaseMapping to the id of the item in that db

property visible_children[source]
property display_id[source]

See super class.

property display_icon[source]

Returns an icon to display next to the name. Reimplement in subclasses to return something nice.

property display_data[source]

See super class.

property child_item_class[source]

Returns ObjectClassItem.

item_type = 'root'[source]
set_data(column, value, role)[source]

See base class.

_polish_children(children)[source]

See base class.

class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityClassItem(model, db_map_ids=None)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_item.MultiDBTreeItem

An entity_class item.

Parameters
  • model (MinimalTreeModel, optional) – item’s model

  • db_map_ids (dict, optional) – maps instances of DatabaseMapping to the id of the item in that db

property display_icon[source]

Returns class icon.

property child_item_class[source]

Returns the type of child items.

property _children_sort_key[source]

Reimplemented so groups are above non-groups.

property display_data[source]

Returns the name for display.

property has_dimensions[source]
visual_key = ['name', 'dimension_name_list', 'superclass_name'][source]
item_type = 'entity_class'[source]
_fetch_index[source]
is_hidden()[source]
default_parameter_data()[source]

Return data to put as default in a parameter table when this item is selected.

data(column, role=Qt.ItemDataRole.DisplayRole)[source]

Returns data for given column and role.

_key_for_index(db_map)[source]
accepts_item(item, db_map)[source]
set_data(column, value, role)[source]

See base class.

_polish_children(children)[source]

See base class.

class spinetoolbox.spine_db_editor.mvcmodels.entity_tree_item.EntityItem(*args, is_member=False, **kwargs)[source]

Bases: spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_item.MultiDBTreeItem

An entity item.

Parameters
  • model (MinimalTreeModel, optional) – item’s model

  • db_map_ids (dict, optional) – maps instances of DatabaseMapping to the id of the item in that db

property is_group[source]
property child_item_class[source]

Child class is always EntityItem.

property display_icon[source]

Returns corresponding class icon.

property element_name_list[source]
property element_byname_list[source]
property byname[source]
property entity_class_name[source]
property entity_class_key[source]
property display_data[source]

Returns the name for display.

property edit_data[source]
visual_key = ['entity_class_name', 'entity_byname'][source]
item_type = 'entity'[source]
_fetch_index[source]
_entity_group_index[source]
data(column, role=Qt.ItemDataRole.DisplayRole)[source]

Returns data for given column and role.

set_data(column, value, role)[source]

See base class.

default_parameter_data()[source]

Return data to put as default in a parameter table when this item is selected.

is_valid()[source]

See base class.

Additionally, checks that the parent entity (if any) is still an element in this entity.

_can_fetch_more_entity_groups()[source]
can_fetch_more()[source]

Returns whether this item can fetch more.

_fetch_more_entity_groups()[source]
fetch_more()[source]

Fetches children from all associated databases.

_key_for_index(db_map)[source]
_key_for_entity_group_index(db_map)[source]
accepts_item(item, db_map)[source]
_accepts_entity_group_item(item, db_map)[source]
_handle_entity_group_items_added(db_map_data)[source]
_handle_entity_group_items_removed(db_map_data)[source]
tear_down()[source]

Do stuff after the item has been removed.