Dropdown
Dropdown type as a replacement for Choice.
They are functionally equivalent, but the Dropdown type provides a default value of a read only field when there are no options to choose from.
Dropdown = Choice | Any
module-attribute
Dropdown type definition.
"... or Any" makes for a very weak type definition, admittedly. However, this is what we get when combining Choice and read_only_field.
generate_dropdown(label, options)
Generate a dropdown menu using the choice class.
If there are no options, this method instead returns a read only field that tells the user that there are no options available.