Use ThemableChoiceField

There are still remain some ChoiceField that have not covered.

Closes-Bug: #1732317
Change-Id: Ib9be4f252eba08374f87e4fef5e702a6ea8c1226
This commit is contained in:
Cao Xuan Hoang 2017-11-14 13:42:22 +07:00
parent d768502abf
commit f7eec152c2
3 changed files with 9 additions and 8 deletions

View File

@ -24,8 +24,8 @@ from openstack_dashboard import api
class AdminFloatingIpAllocate(forms.SelfHandlingForm): class AdminFloatingIpAllocate(forms.SelfHandlingForm):
pool = forms.ChoiceField(label=_("Pool")) pool = forms.ThemableChoiceField(label=_("Pool"))
tenant = forms.ChoiceField(label=_("Project")) tenant = forms.ThemableChoiceField(label=_("Project"))
floating_ip_address = forms.IPField( floating_ip_address = forms.IPField(
label=_("Floating IP Address (optional)"), label=_("Floating IP Address (optional)"),
required=False, required=False,

View File

@ -55,10 +55,11 @@ class UpdatePortInfoAction(workflows.Action):
vnic_type for vnic_type in api.neutron.VNIC_TYPES vnic_type for vnic_type in api.neutron.VNIC_TYPES
if vnic_type[0] in supported_vnic_types if vnic_type[0] in supported_vnic_types
] ]
self.fields['binding__vnic_type'] = forms.ChoiceField( self.fields['binding__vnic_type'] = (
choices=vnic_type_choices, forms.ThemableChoiceField(
label=_("Binding: VNIC Type"), choices=vnic_type_choices,
required=False) label=_("Binding: VNIC Type"),
required=False))
except Exception: except Exception:
msg = _("Unable to verify the VNIC types extension in Neutron") msg = _("Unable to verify the VNIC types extension in Neutron")
exceptions.handle(self.request, msg) exceptions.handle(self.request, msg)

View File

@ -42,8 +42,8 @@ class CreateForm(forms.SelfHandlingForm):
enable_snat = forms.BooleanField(label=_("Enable SNAT"), enable_snat = forms.BooleanField(label=_("Enable SNAT"),
initial=True, initial=True,
required=False) required=False)
mode = forms.ChoiceField(label=_("Router Type")) mode = forms.ThemableChoiceField(label=_("Router Type"))
ha = forms.ChoiceField(label=_("High Availability Mode")) ha = forms.ThemableChoiceField(label=_("High Availability Mode"))
az_hints = forms.MultipleChoiceField( az_hints = forms.MultipleChoiceField(
label=_("Availability Zone Hints"), label=_("Availability Zone Hints"),
required=False, required=False,