diff --git a/horizon/forms/__init__.py b/horizon/forms/__init__.py index 4f72b2292f..997199ea33 100644 --- a/horizon/forms/__init__.py +++ b/horizon/forms/__init__.py @@ -37,6 +37,7 @@ from horizon.forms.fields import ThemableCheckboxInput # noqa from horizon.forms.fields import ThemableCheckboxSelectMultiple # noqa from horizon.forms.fields import ThemableChoiceField # noqa from horizon.forms.fields import ThemableDynamicChoiceField # noqa +from horizon.forms.fields import ThemableDynamicTypedChoiceField # noqa from horizon.forms.fields import ThemableSelectWidget # noqa from horizon.forms.views import ModalFormMixin # noqa from horizon.forms.views import ModalFormView # noqa diff --git a/horizon/forms/fields.py b/horizon/forms/fields.py index cfcc73ba88..c928b5387f 100644 --- a/horizon/forms/fields.py +++ b/horizon/forms/fields.py @@ -335,6 +335,12 @@ class DynamicTypedChoiceField(DynamicChoiceField, fields.TypedChoiceField): pass +class ThemableDynamicTypedChoiceField(ThemableDynamicChoiceField, + fields.TypedChoiceField): + """Simple mix of ``ThemableDynamicChoiceField`` & ``TypedChoiceField``.""" + pass + + class ThemableCheckboxInput(widgets.CheckboxInput): """A subclass of the ``Checkbox`` widget which renders extra markup to allow a custom checkbox experience. diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py index cbc549ce85..7ee001f6a0 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py @@ -30,10 +30,11 @@ ALLOCATE_URL = "horizon:project:access_and_security:floating_ips:allocate" class AssociateIPAction(workflows.Action): - ip_id = forms.DynamicTypedChoiceField(label=_("IP Address"), - coerce=filters.get_int_or_uuid, - empty_value=None, - add_item_link=ALLOCATE_URL) + ip_id = forms.ThemableDynamicTypedChoiceField( + label=_("IP Address"), + coerce=filters.get_int_or_uuid, + empty_value=None, + add_item_link=ALLOCATE_URL) instance_id = forms.ThemableChoiceField(label=_("Instance")) class Meta(object):