當前位置: 首頁>>代碼示例>>Python>>正文


Python forms.HiddenInput方法代碼示例

本文整理匯總了Python中horizon.forms.HiddenInput方法的典型用法代碼示例。如果您正苦於以下問題:Python forms.HiddenInput方法的具體用法?Python forms.HiddenInput怎麽用?Python forms.HiddenInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在horizon.forms的用法示例。


在下文中一共展示了forms.HiddenInput方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: populate_network_choices

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def populate_network_choices(self, request):
        network_list = []
        try:
            if api.base.is_service_enabled(request, 'network'):
                tenant_id = self.request.user.tenant_id
                networks = api.neutron.network_list_for_tenant(request,
                                                               tenant_id)
                network_list = [(network.id, network.name_or_id)
                                for network in networks]
            else:
                self.fields['network'].widget = forms.HiddenInput()
        except exceptions.ServiceCatalogException:
            network_list = []
            redirect = reverse('horizon:project:database_clusters:index')
            exceptions.handle(request,
                              _('Unable to retrieve networks.'),
                              redirect=redirect)
        return network_list 
開發者ID:openstack,項目名稱:trove-dashboard,代碼行數:20,代碼來源:forms.py

示例2: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, *args, **kwargs):
        super(self.__class__, self).__init__(request, *args, **kwargs)
        # populate share_id
        share_id = kwargs.get('initial', {}).get('share_id', [])
        self.fields['share_id'] = forms.CharField(
            widget=forms.HiddenInput(), initial=share_id) 
開發者ID:openstack,項目名稱:manila-ui,代碼行數:8,代碼來源:forms.py

示例3: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, *args, **kwargs):
        super(CreateReplicaForm, self).__init__(request, *args, **kwargs)

        # populate share_id
        share_id = kwargs.get('initial', {}).get('share_id', [])
        self.fields['share_id'] = forms.CharField(widget=forms.HiddenInput(),
                                                  initial=share_id)

        availability_zones = manila.availability_zone_list(request)
        self.fields['availability_zone'].choices = (
            [(az.name, az.name) for az in availability_zones]) 
開發者ID:openstack,項目名稱:manila-ui,代碼行數:13,代碼來源:forms.py

示例4: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, *args, **kwargs):
        super(self.__class__, self).__init__(request, *args, **kwargs)
        # populate share_group_id
        sg_id = kwargs.get('initial', {}).get('share_group_id', [])
        self.fields['share_group_id'] = forms.CharField(
            widget=forms.HiddenInput(), initial=sg_id) 
開發者ID:openstack,項目名稱:manila-ui,代碼行數:8,代碼來源:forms.py

示例5: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, context, *args, **kwargs):
        super(UpdateDefaultShareQuotasAction, self).__init__(
            request, context, *args, **kwargs)
        disabled_quotas = context['disabled_quotas']
        for field in disabled_quotas:
            if field in self.fields:
                self.fields[field].required = False
                self.fields[field].widget = forms.HiddenInput() 
開發者ID:openstack,項目名稱:manila-ui,代碼行數:10,代碼來源:workflows.py

示例6: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, context, *args, **kwargs):
        super(AddRouterParametersInfoAction, self).__init__(
            request, context, *args, **kwargs)
        if 'with_parameters' in context:
            self.fields['with_parameters'] = forms.BooleanField(
                initial=context['with_parameters'],
                required=False,
                widget=forms.HiddenInput()
            ) 
開發者ID:openstack,項目名稱:networking-bgpvpn,代碼行數:11,代碼來源:workflows.py

示例7: _hide_file_source_type

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def _hide_file_source_type(self):
        self.fields['image_file'].widget = HiddenInput()
        source_type = self.fields['source_type']
        source_type.choices = [choice for choice in source_type.choices
                               if choice[0] != 'file']
        if len(source_type.choices) == 1:
            source_type.widget = HiddenInput() 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:9,代碼來源:forms.py

示例8: _hide_url_source_type

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def _hide_url_source_type(self):
        self.fields['copy_from'].widget = HiddenInput()
        source_type = self.fields['source_type']
        source_type.choices = [choice for choice in source_type.choices
                               if choice[0] != 'url']
        if len(source_type.choices) == 1:
            source_type.widget = HiddenInput() 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:9,代碼來源:forms.py

示例9: _hide_is_public

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def _hide_is_public(self):
        self.fields['is_public'].widget = HiddenInput()
        self.fields['is_public'].initial = False 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:5,代碼來源:forms.py

示例10: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, context, *args, **kwargs):
        super(CreateSubnetInfoAction, self).__init__(request, context, *args,
                                                     **kwargs)
        if not getattr(settings, 'OPENSTACK_NEUTRON_NETWORK',
                       {}).get('enable_ipv6', True):
            self.fields['ip_version'].widget = forms.HiddenInput()
            self.fields['ip_version'].initial = 4 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:9,代碼來源:workflows.py

示例11: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, context, *args, **kwargs):
        super(UpdateSubnetDetailAction, self).__init__(request, context,
                                                       *args, **kwargs)
        # TODO(amotoki): Due to Neutron bug 1362966, we cannot pass "None"
        # to Neutron. It means we cannot set IPv6 two modes to
        # "No option selected".
        # Until bug 1362966 is fixed, we disable this field.
        # if context['ip_version'] != 6:
        #     self.fields['ipv6_modes'].widget = forms.HiddenInput()
        #     self.fields['ipv6_modes'].required = False
        self.fields['ipv6_modes'].widget = forms.HiddenInput()
        self.fields['ipv6_modes'].required = False 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:14,代碼來源:workflows.py

示例12: build_node_group_fields

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def build_node_group_fields(action, name, template, count, serialized=None):
    action.fields[name] = forms.CharField(
        label=_("Name"),
        widget=forms.TextInput())

    action.fields[template] = forms.CharField(
        label=_("Node group cluster"),
        widget=forms.HiddenInput())

    action.fields[count] = forms.IntegerField(
        label=_("Count"),
        min_value=0,
        widget=forms.HiddenInput())
    action.fields[serialized] = forms.CharField(
        widget=forms.HiddenInput()) 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:17,代碼來源:workflow_helpers.py

示例13: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, *args, **kwargs):
        super(GeneralConfigAction, self).__init__(request, *args, **kwargs)
        plugin, hadoop_version = whelpers.\
            get_plugin_and_hadoop_version(request)

        self.fields["plugin_name"] = forms.CharField(
            widget=forms.HiddenInput(),
            initial=plugin
        )
        self.fields["hadoop_version"] = forms.CharField(
            widget=forms.HiddenInput(),
            initial=hadoop_version
        ) 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:15,代碼來源:create.py

示例14: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, *args, **kwargs):
        super(JobExecutionGeneralConfigAction, self).__init__(request,
                                                              *args,
                                                              **kwargs)

        if request.REQUEST.get("job_id", None) is None:
            self.fields["job"] = forms.ChoiceField(
                label=_("Job"))
            self.fields["job"].choices = self.populate_job_choices(request)
        else:
            self.fields["job"] = forms.CharField(
                widget=forms.HiddenInput(),
                initial=request.REQUEST.get("job_id", None)) 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:15,代碼來源:launch.py

示例15: __init__

# 需要導入模塊: from horizon import forms [as 別名]
# 或者: from horizon.forms import HiddenInput [as 別名]
def __init__(self, request, context, *args, **kwargs):
        self._init_images_cache()
        self.request = request
        self.context = context
        super(SetInstanceDetailsAction, self).__init__(
            request, context, *args, **kwargs)

        # Hide the device field if the hypervisor doesn't support it.
        if not nova.can_set_mount_point():
            self.fields['device_name'].widget = forms.widgets.HiddenInput()

        source_type_choices = [
            ('', _("Select source")),
            ("image_id", _("Boot from image")),
            ("instance_snapshot_id", _("Boot from snapshot")),
        ]
        if base.is_service_enabled(request, 'volume'):
            source_type_choices.append(("volume_id", _("Boot from volume")))

            try:
                if api.nova.extension_supported("BlockDeviceMappingV2Boot",
                                                request):
                    source_type_choices.append(
                        ("volume_image_id",
                         _("Boot from image (creates a new volume)")))
            except Exception:
                exceptions.handle(request, _('Unable to retrieve extensions '
                                             'information.'))

            source_type_choices.append(
                ("volume_snapshot_id",
                 _("Boot from volume snapshot (creates a new volume)")))
        self.fields['source_type'].choices = source_type_choices 
開發者ID:CiscoSystems,項目名稱:avos,代碼行數:35,代碼來源:create_instance.py


注:本文中的horizon.forms.HiddenInput方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。