예제 #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'