spinetoolbox.project_items.data_store.data_store
¶
Module for data store class.
authors: |
|
---|---|
date: | 18.12.2017 |
Module Contents¶
-
class
spinetoolbox.project_items.data_store.data_store.
DataStore
(name, description, x, y, toolbox, project, logger, url=None)[source]¶ Bases:
spinetoolbox.project_item.ProjectItem
Data Store class.
Parameters: - name (str) – Object name
- description (str) – Object description
- x (float) – Initial X coordinate of item icon
- y (float) – Initial Y coordinate of item icon
- toolbox (ToolboxUI) – QMainWindow instance
- project (SpineToolboxProject) – the project this item belongs to
- logger (LoggerInterface) – a logger instance
- url (str or dict) – SQLAlchemy url
-
make_signal_handler_dict
(self)[source]¶ Returns a dictionary of all shared signals and their handlers. This is to enable simpler connecting and disconnecting.
-
_make_url
(self, log_errors=True)[source]¶ Returns a sqlalchemy url from the current url attribute or None if not valid.
-
open_sqlite_file
(self, checked=False)[source]¶ Open file browser where user can select the path to an SQLite file that they want to use.
-
load_url_into_selections
(self, url)[source]¶ Load given url attribute into shared widget selections.
-
enable_no_dialect
(self)[source]¶ Adjust widget enabled status to default when no dialect is selected.
-
update_name_label
(self)[source]¶ Update Data Store tab name label. Used only when renaming project items.
-
static
upgrade_from_no_version_to_version_1
(item_name, old_item_dict, old_project_dir)[source]¶ See base class.
Returns the context menu for this item.
Parameters: - parent (QWidget) – The widget that is controlling the menu
- pos (QPoint) – Position on screen
Applies given action from context menu. Implement in subclasses as needed.
Parameters: - parent (QWidget) – The widget that is controlling the menu
- action (str) – The selected action
-
rename
(self, new_name)[source]¶ Rename this item.
Parameters: new_name (str) – New name Returns: True if renaming succeeded, False otherwise Return type: bool