SelectDataset
Last updated
Last updated
SelectDataset
widget is a dropdown menu that allows users to select a dataset or multiple datasets from a list of available datasets in the current project. It displays the name of each dataset in the list.
default_id
int
Dataset
ID
project_id
int
Project
ID
multiselect
bool
Allow to select all datasets in current project
compact
bool
Show only dataset select
show_label
bool
Show label
size
Literal["large", "small", "mini", None]
Selector size
disabled
bool
Disable dataset select
widget_id
str
ID of the widget
select_all_datasets
bool
Select all datasets
allowed_project_types
List[ProjectType]
List of allowed project types
Determine Dataset
will be selected by default.
type: int
default value: None
Determine Project
will be selected by default.
type: int
default value: None
Allow to select multiple datasets in current project.
type: bool
default value: false
Show only Dataset
select.
type: bool
default value: false
Determine show text Dataset
on widget or not, work only if compact
is True.
type: bool
default value: True
Size of input.
type: Literal["large", "small", "mini", None]
default value: None
Determine Dataset
select ability.
type: bool
default value: false
Select all datasets in current project. Work only if multiselect
is True
.
type: bool
default value: false
List of allowed project types.
type: List[ProjectType]
default value: None
ID of the widget.
type: str
default value: None
get_selected_id()
Return selected dataset ID
, if multiselect
is True
raise ValueError
.
get_selected_ids()
Return selected dataset IDs
, if multiselect
is False
raise ValueError
.
get_selected_project_id()
Return id of selected Project, if compact
is False
.
set_project_id()
Set current project id.
disable()
Set disabled
attribute == True
.
enable()
Set disabled
attribute == False
.
@value_changed
Decorator functions is handled when selected dataset ID
is changed.
You can find this example in our Github repository:
ui-widgets-demos/selection/005_select_dataset/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
project_id
and dataset_id
SelectDataset
widgetPrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.