示例#1
0
    def __init__(self, request=None, *args, **kwargs):
        self.request = request
        rest_data = kwargs.pop('rest_data')
        super(CMAuthenticationForm, self).__init__(*args, **kwargs)

        self.fields['cm'] = forms.ChoiceField(choices=parsing.parse_cm_list(rest_data),
                                              initial=request.session['user'].default_cluster_id,
                                              widget=SelectWithDisabled(attrs=dict({'class': 'small'})),
                                              label=_("Cluster Manager"))
        self.fields.keyOrder = ['cm', 'password']
示例#2
0
    def __init__(self, *args, **kwargs):
        rest_data = kwargs.pop('rest_data')
        try:
            self.old_email = args[0]['email']
        except Exception:
            self.old_email = kwargs['data']['email']
        super(AccountDataEdit, self).__init__(*args, **kwargs)

        self.fields['default_cluster_id'] = forms.ChoiceField(choices=parsing.parse_cm_list(rest_data), label=_('Default CM'))
        self.fields['default_cluster_id'].widget.attrs['class'] = 'medium'
示例#3
0
文件: user.py 项目: cloudcache/cc1
    def __init__(self, request=None, *args, **kwargs):
        self.request = request
        rest_data = kwargs.pop('rest_data')
        super(CMAuthenticationForm, self).__init__(*args, **kwargs)

        self.fields['cm'] = forms.ChoiceField(choices=parsing.parse_cm_list(rest_data),
                                              initial=request.session['user'].default_cluster_id,
                                              widget=SelectWithDisabled(attrs=dict({'class': 'small'})),
                                              label=_("Cluster Manager"))
        self.fields.keyOrder = ['cm', 'password']
示例#4
0
文件: user.py 项目: pojoba02/cc1
    def __init__(self, request=None, *args, **kwargs):
        self.request = request
        rest_data = kwargs.pop("rest_data")
        super(CMAuthenticationForm, self).__init__(*args, **kwargs)

        self.fields["cm"] = forms.ChoiceField(
            choices=parsing.parse_cm_list(rest_data),
            initial=request.session["user"].default_cluster_id,
            widget=SelectWithDisabled(attrs=dict({"class": "small"})),
            label=_("Cluster Manager"),
        )
        self.fields.keyOrder = ["cm", "password"]
示例#5
0
文件: user.py 项目: pojoba02/cc1
    def __init__(self, *args, **kwargs):
        rest_data = kwargs.pop("rest_data")
        try:
            self.old_email = args[0]["email"]
        except Exception:
            self.old_email = kwargs["data"]["email"]
        super(AccountDataEdit, self).__init__(*args, **kwargs)

        self.fields["default_cluster_id"] = forms.ChoiceField(
            choices=parsing.parse_cm_list(rest_data), label=_("Default CM")
        )
        self.fields["default_cluster_id"].widget.attrs["class"] = "medium"
示例#6
0
文件: user.py 项目: cloudcache/cc1
    def __init__(self, *args, **kwargs):
        """
        """
        rest_data = kwargs.pop('rest_data')
        try:
            self.old_email = args[0]['email']
        except Exception:
            self.old_email = kwargs['data']['email']
        super(AccountDataEdit, self).__init__(*args, **kwargs)

        self.fields['default_cluster_id'] = forms.ChoiceField(choices=parsing.parse_cm_list(rest_data), label=_('Default CM'))
        self.fields['default_cluster_id'].widget.attrs['class'] = 'medium'